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

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

Issue 1578023: Add notifications to allow desktop notification permissions to be synced. (Closed)
Patch Set: pre-commit Created 10 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
« no previous file with comments | « base/values.cc ('k') | chrome/browser/notifications/desktop_notification_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notification_service.h
diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h
index 8be6f855c3c2d2f361e58ed44f8a0c15981140e3..c3a41f941c198cba5541059840d607358195b1f5 100644
--- a/chrome/browser/notifications/desktop_notification_service.h
+++ b/chrome/browser/notifications/desktop_notification_service.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "chrome/browser/notifications/notification.h"
+#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_service.h"
#include "googleurl/src/gurl.h"
@@ -21,7 +22,7 @@ class Task;
// The DesktopNotificationService is an object, owned by the Profile,
// which provides the creation of desktop "toasts" to web pages and workers.
-class DesktopNotificationService {
+class DesktopNotificationService : public NotificationObserver {
public:
enum DesktopNotificationSource {
PageNotification,
@@ -69,6 +70,11 @@ class DesktopNotificationService {
void GrantPermission(const GURL& origin);
void DenyPermission(const GURL& origin);
+ // NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
NotificationsPrefsCache* prefs_cache() { return prefs_cache_; }
// Creates a data:xxxx URL which contains the full HTML for a notification
@@ -78,6 +84,8 @@ class DesktopNotificationService {
const string16& body);
private:
void InitPrefs();
+ void StartObserving();
+ void StopObserving();
// Save a permission change to the profile.
void PersistPermissionChange(const GURL& origin, bool is_allowed);
« no previous file with comments | « base/values.cc ('k') | chrome/browser/notifications/desktop_notification_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698