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

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

Issue 7655019: Migrate Obsolete NotificationsSettings and remove content_settings::NotificationsProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove include of deleted notifications_prefs_cache.h Created 9 years, 4 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/desktop_notification_service.h
diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h
index 4ef69fdcac361126d570584c7d738654a3a666db..93b3a4cb2e823e007c3579e97c11cb091f35f263 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);

Powered by Google App Engine
This is Rietveld 408576698