summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/desktop_notification_profile_util.h
blob: 988d11e5c6f327adae6b20f54f7790de74aa334f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 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 "base/macros.h"
#include "components/content_settings/core/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);
  static void UsePermission(Profile* profile, const GURL& origin);

 private:
  DISALLOW_IMPLICIT_CONSTRUCTORS(DesktopNotificationProfileUtil);
};

#endif  // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_PROFILE_UTIL_H_