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

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

Issue 376253005: Migrate the notification permission to the new common permission classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 08f33e16c19f5c6e731d79b458c71efa80a6c4ca..cb424f24ca7f1a21320cab6bf9bfcd558a73cfda 100644
--- a/chrome/browser/notifications/desktop_notification_service.h
+++ b/chrome/browser/notifications/desktop_notification_service.h
@@ -17,6 +17,7 @@
#include "base/scoped_observer.h"
#include "base/strings/string16.h"
#include "chrome/browser/content_settings/content_settings_provider.h"
+#include "chrome/browser/content_settings/permission_context_base.h"
#include "chrome/browser/notifications/extension_welcome_notification.h"
#include "chrome/common/content_settings.h"
#include "components/keyed_service/core/keyed_service.h"
@@ -53,7 +54,7 @@ class PrefRegistrySyncable;
// The DesktopNotificationService is an object, owned by the Profile,
// which provides the creation of desktop "toasts" to web pages and workers.
class DesktopNotificationService
- : public KeyedService,
+ : public PermissionContextBase,
public extensions::ExtensionRegistryObserver {
public:
// Register profile-specific prefs of notifications.
@@ -63,11 +64,6 @@ class DesktopNotificationService
NotificationUIManager* ui_manager);
virtual ~DesktopNotificationService();
- // Requests permission for a given origin. |callback| is run when the UI
- // finishes.
- void RequestPermission(const GURL& origin,
- content::RenderFrameHost* render_frame_host,
- const base::Closure& callback);
// Show a desktop notification. If |cancel_callback| is non-null, it's set to
// a callback which can be used to cancel the notification.
@@ -77,10 +73,6 @@ class DesktopNotificationService
content::DesktopNotificationDelegate* delegate,
base::Closure* cancel_callback);
- // Methods to setup and modify permission preferences.
- void GrantPermission(const GURL& origin);
- void DenyPermission(const GURL& origin);
-
// 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.
@@ -104,27 +96,6 @@ class DesktopNotificationService
NotificationDelegate* delegate,
Profile* profile);
- // The default content setting determines how to handle origins that haven't
- // been allowed or denied yet. If |provider_id| is not NULL, the id of the
- // provider which provided the default setting is assigned to it.
- ContentSetting GetDefaultContentSetting(std::string* provider_id);
- void SetDefaultContentSetting(ContentSetting setting);
-
- // NOTE: This should only be called on the UI thread.
- void ResetToDefaultContentSetting();
-
- // Returns all notifications settings. |settings| is cleared before
- // notifications setting are passed to it.
- void GetNotificationsSettings(ContentSettingsForOneType* settings);
-
- // Clears the notifications setting for the given pattern.
- void ClearSetting(const ContentSettingsPattern& pattern);
-
- // Clears the sets of explicitly allowed and denied origins.
- void ResetAllOrigins();
-
- ContentSetting GetContentSetting(const GURL& origin);
-
// Returns true if the notifier with |notifier_id| is allowed to send
// notifications.
bool IsNotifierEnabled(const message_center::NotifierId& notifier_id);
@@ -143,10 +114,6 @@ class DesktopNotificationService
// from the origin itself when dealing with extensions.
base::string16 DisplayNameForOriginInProcessId(const GURL& origin,
int process_id);
-
- // Notifies the observers when permissions settings change.
- void NotifySettingsChange();
-
NotificationUIManager* GetUIManager();
// Called when the string list pref has been changed.

Powered by Google App Engine
This is Rietveld 408576698