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: fix according to comments and update revision Created June 26, 2015, 2:19 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') | test/Notification.cpp » ('J')
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 a6fa146265620ebd4faa813689ae907955092c8c..f680c787730d02c375b367cafd0b0c24aae5f74a 100644
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -186,6 +186,12 @@ namespace AdblockPlus
typedef std::tr1::function<void(const std::string&, const JsValuePtr)> FilterChangeCallback;
/**
+ * 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.
@@ -238,12 +244,23 @@ 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.
+ * available.
Felix Dahlke 2015/06/30 19:45:32 Guess this line can be removed?
sergei 2015/07/01 11:46:08 Done, sorry overlooked.
+ */
+ void RemoveShowNotificationCallback();
/**
* Checks if any active filter matches the supplied URL.
@@ -386,6 +403,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') | test/Notification.cpp » ('J')

Powered by Google App Engine
This is Rietveld