Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: src/Notification.cpp

Issue 5068192028295168: Issue 1919 - add Notifications::GetLinks() (Closed)
Left Patch Set: Created Feb. 2, 2015, 2:14 p.m.
Right Patch Set: get rid of c++11 Created Feb. 2, 2015, 2:51 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include/AdblockPlus/Notification.h ('k') | test/Notification.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 std::vector<std::string> retValue; 82 std::vector<std::string> retValue;
83 JsValuePtr jsLinks = GetProperty("links"); 83 JsValuePtr jsLinks = GetProperty("links");
84 if (!jsLinks->IsArray()) 84 if (!jsLinks->IsArray())
85 { 85 {
86 return retValue; 86 return retValue;
87 } 87 }
88 JsValueList urlLinksList = jsLinks->AsList(); 88 JsValueList urlLinksList = jsLinks->AsList();
89 for (JsValueList::const_iterator linkIterator = urlLinksList.begin(); 89 for (JsValueList::const_iterator linkIterator = urlLinksList.begin();
90 linkIterator != urlLinksList.end(); ++linkIterator) 90 linkIterator != urlLinksList.end(); ++linkIterator)
91 { 91 {
92 retValue.emplace_back((*linkIterator)->AsString()); 92 retValue.push_back((*linkIterator)->AsString());
Felix Dahlke 2015/02/02 14:40:48 C++11 again! :)
sergei 2015/02/02 14:51:28 Sorry, fixed.
93 } 93 }
94 return retValue; 94 return retValue;
95 } 95 }
96 96
97 void Notification::MarkAsShown() 97 void Notification::MarkAsShown()
98 { 98 {
99 JsValueList params; 99 JsValueList params;
100 params.push_back(GetProperty("id")); 100 params.push_back(GetProperty("id"));
101 jsEngine->Evaluate("API.markNotificationAsShown")->Call(params); 101 jsEngine->Evaluate("API.markNotificationAsShown")->Call(params);
102 } 102 }
(...skipping 18 matching lines...) Expand all
121 { 121 {
122 notification->title = jsTitle->AsString(); 122 notification->title = jsTitle->AsString();
123 } 123 }
124 JsValuePtr jsMessage = jsTexts->GetProperty("message"); 124 JsValuePtr jsMessage = jsTexts->GetProperty("message");
125 if (jsMessage->IsString()) 125 if (jsMessage->IsString())
126 { 126 {
127 notification->message = jsMessage->AsString(); 127 notification->message = jsMessage->AsString();
128 } 128 }
129 return notification; 129 return notification;
130 } 130 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld