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

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 29317074: Issue 2693 - Update adblockplus dependency (Closed)
Patch Set: rebase Created July 2, 2015, 1:37 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 | « ensure_dependencies.py ('k') | lib/api.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FilterEngine.h
diff --git a/include/AdblockPlus/FilterEngine.h b/include/AdblockPlus/FilterEngine.h
index 0a36af2be87736480d654655642a4008f38f3b5f..6cebaa70b4b921cf3d6ea5ce97723ca22689bc2d 100644
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -191,6 +191,12 @@ namespace AdblockPlus
typedef std::map<std::string, AdblockPlus::JsValuePtr> Prefs;
/**
+ * Callback type invoked when a new notification should be shown.
+ * The parameter is the Notification object to be shown.
+ */
+ typedef std::tr1::function<void(const NotificationPtr&)> ShowNotificationCallback;
+
+ /**
* Constructor.
* @param jsEngine `JsEngine` instance used to run JavaScript code
* internally.
@@ -247,12 +253,22 @@ namespace AdblockPlus
std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const;
/**
- * Determines which notification is to be shown next.
+ * Invokes the listener set via SetNotificationAvailableCallback() with the
+ * next notification to be shown.
* @param url URL to match notifications to (optional).
- * @return Notification to be shown, or `null` if there is no any.
*/
- NotificationPtr GetNextNotificationToShow(
- const std::string& url = std::string());
+ void ShowNextNotification(const std::string& url = std::string());
+
+ /**
+ * Sets the callback invoked when a notification should be shown.
+ * @param callback Callback to invoke.
+ */
+ void SetShowNotificationCallback(const ShowNotificationCallback& value);
+
+ /**
+ * Removes the callback invoked when a notification should be shown.
+ */
+ void RemoveShowNotificationCallback();
/**
* Checks if any active filter matches the supplied URL.
@@ -395,6 +411,8 @@ namespace AdblockPlus
void UpdateCheckDone(const std::string& eventName,
UpdateCheckDoneCallback callback, JsValueList& params);
void FilterChanged(FilterChangeCallback callback, JsValueList& params);
+ void ShowNotification(const ShowNotificationCallback& callback,
+ const JsValueList& params);
};
}
« no previous file with comments | « ensure_dependencies.py ('k') | lib/api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld