summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/notifications_prefs_cache.h
diff options
context:
space:
mode:
authorzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 21:48:10 +0000
committerzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 21:48:10 +0000
commit84064220a7e5a37715aeb428a80b6474f9799cc2 (patch)
tree42c39d3d503379a65e35a56da12a4fbb1604ac91 /chrome/browser/notifications/notifications_prefs_cache.h
parent9a371cd2332d32818bdeb783d364c108faf1dd53 (diff)
downloadchromium_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/notifications_prefs_cache.h')
-rw-r--r--chrome/browser/notifications/notifications_prefs_cache.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/notifications/notifications_prefs_cache.h b/chrome/browser/notifications/notifications_prefs_cache.h
index de00774..1b87a29 100644
--- a/chrome/browser/notifications/notifications_prefs_cache.h
+++ b/chrome/browser/notifications/notifications_prefs_cache.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATIONS_PREFS_CACHE_H_
#include <set>
+#include <vector>
#include "base/ref_counted.h"
#include "googleurl/src/gurl.h"
@@ -19,7 +20,7 @@ class ListValue;
class NotificationsPrefsCache
: public base::RefCountedThreadSafe<NotificationsPrefsCache> {
public:
- NotificationsPrefsCache(const ListValue* allowed, const ListValue* denied);
+ NotificationsPrefsCache();
void set_is_initialized(bool val) { is_initialized_ = val; }
bool is_initialized() { return is_initialized_; }
@@ -33,6 +34,14 @@ class NotificationsPrefsCache
void CacheAllowedOrigin(const GURL& origin);
void CacheDeniedOrigin(const GURL& origin);
+ // Set the cache to the supplied values. This clears the current
+ // contents of the cache.
+ void SetCacheAllowedOrigins(const std::vector<GURL>& allowed);
+ void SetCacheDeniedOrigins(const std::vector<GURL>& denied);
+
+ static void ListValueToGurlVector(const ListValue& origin_list,
+ std::vector<GURL>* origin_vector);
+
private:
friend class base::RefCountedThreadSafe<NotificationsPrefsCache>;