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

Unified Diff: chrome/browser/notifications/desktop_notification_profile_util.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_profile_util.h
diff --git a/chrome/browser/notifications/desktop_notification_profile_util.h b/chrome/browser/notifications/desktop_notification_profile_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..15653d00fb9dc0fd67f627c438168a087e139ebb
--- /dev/null
+++ b/chrome/browser/notifications/desktop_notification_profile_util.h
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_PROFILE_UTIL_H_
+#define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_PROFILE_UTIL_H_
+
+#include "chrome/common/content_settings.h"
+
+class Profile;
+
+// A series of common operations to interact with the profile's Desktop
+// Notification settings.
+class DesktopNotificationProfileUtil {
+ public:
+ // NOTE: This should only be called on the UI thread.
+ static void ResetToDefaultContentSetting(Profile* profile);
+
+ // Clears the notifications setting for the given pattern.
+ static void ClearSetting(
+ Profile* profile, const ContentSettingsPattern& pattern);
+
+ // Methods to setup and modify permission preferences.
+ static void GrantPermission(Profile* profile, const GURL& origin);
+ static void DenyPermission(Profile* profile, const GURL& origin);
+ static void GetNotificationsSettings(
+ Profile* profile, ContentSettingsForOneType* settings);
+ static ContentSetting GetContentSetting(Profile* profile, const GURL& origin);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(DesktopNotificationProfileUtil);
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_PROFILE_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698