diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 21:48:10 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 21:48:10 +0000 |
commit | 84064220a7e5a37715aeb428a80b6474f9799cc2 (patch) | |
tree | 42c39d3d503379a65e35a56da12a4fbb1604ac91 /chrome/browser/notifications/desktop_notification_service.h | |
parent | 9a371cd2332d32818bdeb783d364c108faf1dd53 (diff) | |
download | chromium_src-84064220a7e5a37715aeb428a80b6474f9799cc2.zip chromium_src-84064220a7e5a37715aeb428a80b6474f9799cc2.tar.gz chromium_src-84064220a7e5a37715aeb428a80b6474f9799cc2.tar.bz2 |
Add notifications to allow desktop notification permissions to be synced.
Fix a bug where sites can be added to allow and deny lists multiple times.
BUG=none
TEST=Open two browsers with separate profiles. Request permission for notifications on a site on one. Check that the permissions are the same on the other browser.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=44234
Review URL: http://codereview.chromium.org/1578023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/desktop_notification_service.h')
-rw-r--r-- | chrome/browser/notifications/desktop_notification_service.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h index 8be6f85..c3a41f9 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); |