OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "chrome/browser/content_settings/content_settings_provider.h" | 16 #include "chrome/browser/content_settings/content_settings_provider.h" |
17 #include "chrome/browser/content_settings/host_content_settings_map.h" | |
18 #include "chrome/browser/profiles/profile_keyed_service.h" | 17 #include "chrome/browser/profiles/profile_keyed_service.h" |
19 #include "chrome/common/content_settings.h" | 18 #include "chrome/common/content_settings.h" |
20 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
22 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
25 | 24 |
26 class ContentSettingsPattern; | 25 class ContentSettingsPattern; |
27 class Extension; | 26 class Extension; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // been allowed or denied yet. If |provider_id| is not NULL, the id of the | 99 // been allowed or denied yet. If |provider_id| is not NULL, the id of the |
101 // provider which provided the default setting is assigned to it. | 100 // provider which provided the default setting is assigned to it. |
102 ContentSetting GetDefaultContentSetting(std::string* provider_id); | 101 ContentSetting GetDefaultContentSetting(std::string* provider_id); |
103 void SetDefaultContentSetting(ContentSetting setting); | 102 void SetDefaultContentSetting(ContentSetting setting); |
104 | 103 |
105 // NOTE: This should only be called on the UI thread. | 104 // NOTE: This should only be called on the UI thread. |
106 void ResetToDefaultContentSetting(); | 105 void ResetToDefaultContentSetting(); |
107 | 106 |
108 // Returns all notifications settings. |settings| is cleared before | 107 // Returns all notifications settings. |settings| is cleared before |
109 // notifications setting are passed to it. | 108 // notifications setting are passed to it. |
110 void GetNotificationsSettings( | 109 void GetNotificationsSettings(ContentSettingsForOneType* settings); |
111 HostContentSettingsMap::SettingsForOneType* settings); | |
112 | 110 |
113 // Clears the notifications setting for the given pattern. | 111 // Clears the notifications setting for the given pattern. |
114 void ClearSetting(const ContentSettingsPattern& pattern); | 112 void ClearSetting(const ContentSettingsPattern& pattern); |
115 | 113 |
116 // Clears the sets of explicitly allowed and denied origins. | 114 // Clears the sets of explicitly allowed and denied origins. |
117 void ResetAllOrigins(); | 115 void ResetAllOrigins(); |
118 | 116 |
119 ContentSetting GetContentSetting(const GURL& origin); | 117 ContentSetting GetContentSetting(const GURL& origin); |
120 | 118 |
121 // Checks to see if a given origin has permission to create desktop | 119 // Checks to see if a given origin has permission to create desktop |
(...skipping 22 matching lines...) Expand all Loading... |
144 // Non-owned pointer to the notification manager which manages the | 142 // Non-owned pointer to the notification manager which manages the |
145 // UI for desktop toasts. | 143 // UI for desktop toasts. |
146 NotificationUIManager* ui_manager_; | 144 NotificationUIManager* ui_manager_; |
147 | 145 |
148 content::NotificationRegistrar notification_registrar_; | 146 content::NotificationRegistrar notification_registrar_; |
149 | 147 |
150 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); | 148 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); |
151 }; | 149 }; |
152 | 150 |
153 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 151 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
OLD | NEW |