15f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
25f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// found in the LICENSE file.
45f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
55f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_PROFILE_UTIL_H_
65f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_PROFILE_UTIL_H_
75f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
81320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "base/macros.h"
91320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "components/content_settings/core/common/content_settings.h"
105f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
115f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class Profile;
125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// A series of common operations to interact with the profile's Desktop
145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Notification settings.
155f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class DesktopNotificationProfileUtil {
165f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) public:
175f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // NOTE: This should only be called on the UI thread.
185f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static void ResetToDefaultContentSetting(Profile* profile);
195f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
205f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // Clears the notifications setting for the given pattern.
215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static void ClearSetting(
225f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)      Profile* profile, const ContentSettingsPattern& pattern);
235f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
245f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  // Methods to setup and modify permission preferences.
255f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static void GrantPermission(Profile* profile, const GURL& origin);
265f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static void DenyPermission(Profile* profile, const GURL& origin);
275f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static void GetNotificationsSettings(
285f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)      Profile* profile, ContentSettingsForOneType* settings);
295f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static ContentSetting GetContentSetting(Profile* profile, const GURL& origin);
305f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  static void UsePermission(Profile* profile, const GURL& origin);
315f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
325f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) private:
335f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)  DISALLOW_IMPLICIT_CONSTRUCTORS(DesktopNotificationProfileUtil);
345f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)};
355f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
365f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#endif  // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_PROFILE_UTIL_H_
37