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

Unified Diff: src/Notification.cpp

Issue 5068192028295168: Issue 1919 - add Notifications::GetLinks() (Closed)
Patch Set: Created Feb. 2, 2015, 2:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/AdblockPlus/Notification.h ('k') | test/Notification.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/Notification.cpp
===================================================================
--- a/src/Notification.cpp
+++ b/src/Notification.cpp
@@ -77,6 +77,23 @@
return message;
}
+std::vector<std::string> Notification::GetLinks() const
+{
+ std::vector<std::string> retValue;
+ JsValuePtr jsLinks = GetProperty("links");
+ if (!jsLinks->IsArray())
+ {
+ return retValue;
+ }
+ JsValueList urlLinksList = jsLinks->AsList();
+ for (JsValueList::const_iterator linkIterator = urlLinksList.begin();
+ linkIterator != urlLinksList.end(); ++linkIterator)
+ {
+ retValue.emplace_back((*linkIterator)->AsString());
Felix Dahlke 2015/02/02 14:40:48 C++11 again! :)
sergei 2015/02/02 14:51:28 Sorry, fixed.
+ }
+ return retValue;
+}
+
void Notification::MarkAsShown()
{
JsValueList params;
« no previous file with comments | « include/AdblockPlus/Notification.h ('k') | test/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld