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

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

Issue 1814923002: Nuke NotificationUIManager from PlatformNotificationServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@profile_manager_load
Patch Set: Created 4 years, 8 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_bridge.h
diff --git a/chrome/browser/notifications/notification_bridge.h b/chrome/browser/notifications/notification_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..62d2fc9b338feed78532a0678f88da0a64c7cab7
--- /dev/null
+++ b/chrome/browser/notifications/notification_bridge.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_BRIDGE_H_
+#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_BRIDGE_H_
+
+#include <set>
+#include <string>
+#include "base/macros.h"
Peter Beverloo 2016/04/18 14:57:09 micro nit: don't we usually have blank lines betwe
Miguel Garcia 2016/04/19 14:24:57 Done.
+
+class Notification;
+
+// This class bridges the display and click operations available on a
+// notification.
Peter Beverloo 2016/04/18 14:57:09 Let's try to be a bit more inclusive. What about:
Miguel Garcia 2016/04/19 14:24:57 Except that right now there is no bridge for chrom
+// TODO(miguelg): Add support for click and close events.
+class NotificationBridge {
+ public:
+ static NotificationBridge* Create();
+
+ NotificationBridge() {}
Peter Beverloo 2016/04/18 14:57:09 If we need a static Create method, let's make the
Miguel Garcia 2016/04/19 14:24:57 Done.
+ virtual ~NotificationBridge() {}
+
+ // Shows a toast on screen using the data passed in |notification|.
+ virtual void Display(const std::string& notification_id,
+ const std::string& profile_id,
+ bool is_incognito,
+ const Notification& notification) = 0;
+
+ // Closes a nofication with |notification_id| and |profile_id| if being
+ // displayed.
+ virtual void Close(const std::string& profile_id,
+ const std::string& notification_id) = 0;
+
+ // Fills in |notifications| with a set of notification ids currently being
+ // displayed for a given profile.
+ // The return value expresses whether the underlying platform has the
+ // capability to provide displayed notifications so the empty set
+ // can be disambiguated.
+ virtual bool GetDisplayed(const std::string& profile_id,
+ bool incognito,
+ std::set<std::string>* notification_ids) const = 0;
+
+ // Temporary method while the refactor is finished.
Peter Beverloo 2016/04/18 14:57:09 Please do document what it does and why it's signi
Miguel Garcia 2016/04/19 14:24:57 Done.
+ virtual bool SupportsNotificationCenter() const = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationBridge);
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698