Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2080)

Unified Diff: chrome/browser/notifications/notification_display_service.h

Issue 2093953002: Introduce a new API to handle native notification clicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_display_service.h
diff --git a/chrome/browser/notifications/notification_display_service.h b/chrome/browser/notifications/notification_display_service.h
index 6bbd645747f3eecca310333ac705dab6008ad777..8e82b04b437ad1411f859fad2ec287038cbb67e9 100644
--- a/chrome/browser/notifications/notification_display_service.h
+++ b/chrome/browser/notifications/notification_display_service.h
@@ -8,6 +8,7 @@
#include <set>
#include <string>
#include "base/macros.h"
+#include "chrome/browser/notifications/notification_operation_common.h"
#include "components/keyed_service/core/keyed_service.h"
class Notification;
@@ -27,16 +28,30 @@ class NotificationDisplayService : public KeyedService {
~NotificationDisplayService() override {}
// Displays the |notification| identified by |notification_id|.
- virtual void Display(const std::string& notification_id,
- const Notification& notification) = 0;
+ virtual void Display(
+ notification_operation_common::NotificationHandlerType notification_type,
Peter Beverloo 2016/06/29 00:23:15 In the longer run, taking the services model, this
Peter Beverloo 2016/06/29 00:23:15 Needing to use the `notification_operation_common`
Miguel Garcia 2016/07/05 13:54:50 As discussed offline I am maintaining the type enu
Miguel Garcia 2016/07/05 13:54:50 I went with a class and enum classes.
+ const std::string& notification_id,
+ const Notification& notification) = 0;
// Closes the notification identified by |notification_id|.
- virtual void Close(const std::string& notification_id) = 0;
+ // This only handles programatic close calls, notifications closed
+ // by users get handled by |ProcessNotificationOperation|.
+ virtual void Close(
+ notification_operation_common::NotificationHandlerType notification_type,
+ const std::string& notification_id) = 0;
// Returns whether the implementation can retrieve a list of currently visible
// notifications and stores them in |*notification_ids| when possible.
virtual bool GetDisplayed(std::set<std::string>* notifications) const = 0;
+ // Used by the notification bridge to propagate back events (click, close...)
+ virtual void ProcessNotificationOperation(
+ notification_operation_common::NotificationOperation operation,
+ notification_operation_common::NotificationHandlerType notification_type,
+ const std::string& origin,
+ const std::string& notification_id,
+ int action_index) = 0;
Peter Beverloo 2016/06/29 00:23:15 NotificationDisplayService defines the [feature] -
Miguel Garcia 2016/07/05 13:54:50 Indeed, made it a method of the native display ser
+
// Temporary method while we finish the refactor. Returns whether there is
// a native notification center backing up notifications.
virtual bool SupportsNotificationCenter() const = 0;

Powered by Google App Engine
This is Rietveld 408576698