OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <set> | 8 #include <set> |
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/prefs/pref_member.h" | 14 #include "base/prefs/pref_member.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/profiles/profile_keyed_service.h" | 17 #include "chrome/browser/profiles/profile_keyed_service.h" |
18 #include "chrome/common/content_settings.h" | 18 #include "chrome/common/content_settings.h" |
19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
24 #include "ui/message_center/notifier_settings.h" | 24 #include "ui/message_center/notifier_settings.h" |
25 | 25 |
26 class ContentSettingsPattern; | 26 class ContentSettingsPattern; |
27 class Notification; | 27 class Notification; |
28 class NotificationDelegate; | 28 class NotificationDelegate; |
29 class NotificationUIManager; | 29 class NotificationUIManager; |
30 class PrefRegistrySyncable; | |
31 class Profile; | 30 class Profile; |
32 | 31 |
33 namespace content { | 32 namespace content { |
34 class WebContents; | 33 class WebContents; |
35 struct ShowDesktopNotificationHostMsgParams; | 34 struct ShowDesktopNotificationHostMsgParams; |
36 } | 35 } |
37 | 36 |
38 namespace gfx { | 37 namespace gfx { |
39 class Image; | 38 class Image; |
40 } | 39 } |
41 | 40 |
| 41 namespace user_prefs { |
| 42 class PrefRegistrySyncable; |
| 43 } |
| 44 |
42 // The DesktopNotificationService is an object, owned by the Profile, | 45 // The DesktopNotificationService is an object, owned by the Profile, |
43 // which provides the creation of desktop "toasts" to web pages and workers. | 46 // which provides the creation of desktop "toasts" to web pages and workers. |
44 class DesktopNotificationService : public ProfileKeyedService { | 47 class DesktopNotificationService : public ProfileKeyedService { |
45 public: | 48 public: |
46 enum DesktopNotificationSource { | 49 enum DesktopNotificationSource { |
47 PageNotification, | 50 PageNotification, |
48 WorkerNotification | 51 WorkerNotification |
49 }; | 52 }; |
50 | 53 |
51 // Register profile-specific prefs of notifications. | 54 // Register profile-specific prefs of notifications. |
52 static void RegisterUserPrefs(PrefRegistrySyncable* prefs); | 55 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* prefs); |
53 | 56 |
54 DesktopNotificationService(Profile* profile, | 57 DesktopNotificationService(Profile* profile, |
55 NotificationUIManager* ui_manager); | 58 NotificationUIManager* ui_manager); |
56 virtual ~DesktopNotificationService(); | 59 virtual ~DesktopNotificationService(); |
57 | 60 |
58 // Requests permission (using an info-bar) for a given origin. | 61 // Requests permission (using an info-bar) for a given origin. |
59 // |callback_context| contains an opaque value to pass back to the | 62 // |callback_context| contains an opaque value to pass back to the |
60 // requesting process when the info-bar finishes. | 63 // requesting process when the info-bar finishes. |
61 void RequestPermission(const GURL& origin, | 64 void RequestPermission(const GURL& origin, |
62 int process_id, | 65 int process_id, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // On-memory data for the availability of extensions. | 203 // On-memory data for the availability of extensions. |
201 std::set<std::string> disabled_extension_ids_; | 204 std::set<std::string> disabled_extension_ids_; |
202 | 205 |
203 // On-memory data for the availability of system_component. | 206 // On-memory data for the availability of system_component. |
204 std::set<std::string> disabled_system_component_ids_; | 207 std::set<std::string> disabled_system_component_ids_; |
205 | 208 |
206 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); | 209 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); |
207 }; | 210 }; |
208 | 211 |
209 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 212 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
OLD | NEW |