summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/desktop_notification_service.h
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-31 13:19:12 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-31 13:19:12 +0000
commite190daff7a901701211b34cd92796cf21aca76e2 (patch)
treedc51c4909e8fdcde8a4d891d56ac5015a31f94b2 /chrome/browser/notifications/desktop_notification_service.h
parentb64c0d95e3f8bad04c44bb0ee14529c9060a3e66 (diff)
downloadchromium_src-e190daff7a901701211b34cd92796cf21aca76e2.zip
chromium_src-e190daff7a901701211b34cd92796cf21aca76e2.tar.gz
chromium_src-e190daff7a901701211b34cd92796cf21aca76e2.tar.bz2
Migrate Obsolete NotificationsSettings and remove content_settings::NotificationsProvider.
BUG=63656 TEST=host_content_settings_map_unittest.cc, content_settings_pref_provider.cc, desktop_notifications_service_unittest.cc Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98938 Review URL: http://codereview.chromium.org/7655019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/desktop_notification_service.h')
-rw-r--r--chrome/browser/notifications/desktop_notification_service.h35
1 files changed, 8 insertions, 27 deletions
diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h
index 4ef69fd..93b3a4c 100644
--- a/chrome/browser/notifications/desktop_notification_service.h
+++ b/chrome/browser/notifications/desktop_notification_service.h
@@ -13,9 +13,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
-#include "chrome/browser/content_settings/content_settings_notification_provider.h"
#include "chrome/browser/content_settings/content_settings_provider.h"
-#include "chrome/browser/prefs/pref_change_registrar.h"
+#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/common/content_settings.h"
#include "content/common/notification_observer.h"
@@ -24,11 +23,11 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresenter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
+class ContentSettingsPattern;
class Extension;
class Notification;
class NotificationDelegate;
class NotificationUIManager;
-class NotificationsPrefsCache;
class PrefService;
class Profile;
class TabContents;
@@ -83,8 +82,6 @@ class DesktopNotificationService : public NotificationObserver,
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
// using supplied icon, title, and text, run through a template which contains
// the standard formatting for notifications.
@@ -108,23 +105,17 @@ class DesktopNotificationService : public NotificationObserver,
// NOTE: This should only be called on the UI thread.
void ResetToDefaultContentSetting();
- // Returns all origins that explicitly have been allowed.
- std::vector<GURL> GetAllowedOrigins();
-
- // Returns all origins that explicitly have been denied.
- std::vector<GURL> GetBlockedOrigins();
+ // Returns all notifications settings. |settings| is cleared before
+ // notifications setting are passed to it.
+ void GetNotificationsSettings(
+ HostContentSettingsMap::SettingsForOneType* settings);
- // Removes an origin from the "explicitly allowed" set.
- void ResetAllowedOrigin(const GURL& origin);
-
- // Removes an origin from the "explicitly denied" set.
- void ResetBlockedOrigin(const GURL& origin);
+ // Clears the notifications setting for the given pattern.
+ void ClearSetting(const ContentSettingsPattern& pattern);
// Clears the sets of explicitly allowed and denied origins.
void ResetAllOrigins();
- static void RegisterUserPrefs(PrefService* user_prefs);
-
ContentSetting GetContentSetting(const GURL& origin);
// Checks to see if a given origin has permission to create desktop
@@ -133,12 +124,9 @@ class DesktopNotificationService : public NotificationObserver,
HasPermission(const GURL& origin);
private:
- void InitPrefs();
void StartObserving();
void StopObserving();
- void OnPrefsChanged(const std::string& pref_name);
-
// Takes a notification object and shows it in the UI.
void ShowNotification(const Notification& notification);
@@ -153,17 +141,10 @@ class DesktopNotificationService : public NotificationObserver,
// The profile which owns this object.
Profile* profile_;
- // A cache of preferences which is accessible only on the IO thread
- // to service synchronous IPCs.
- scoped_refptr<NotificationsPrefsCache> prefs_cache_;
-
// Non-owned pointer to the notification manager which manages the
// UI for desktop toasts.
NotificationUIManager* ui_manager_;
- scoped_ptr<content_settings::NotificationProvider> provider_;
-
- PrefChangeRegistrar prefs_registrar_;
NotificationRegistrar notification_registrar_;
DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService);