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: get rid of c++11 Created Feb. 2, 2015, 2:51 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.push_back((*linkIterator)->AsString());
+ }
+ 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