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> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // 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. |
47 class DesktopNotificationService : public BrowserContextKeyedService, | 47 class DesktopNotificationService : public BrowserContextKeyedService, |
48 public content::NotificationObserver { | 48 public content::NotificationObserver { |
49 public: | 49 public: |
50 enum DesktopNotificationSource { | 50 enum DesktopNotificationSource { |
51 PageNotification, | 51 PageNotification, |
52 WorkerNotification | 52 WorkerNotification |
53 }; | 53 }; |
54 | 54 |
55 // Register profile-specific prefs of notifications. | 55 // Register profile-specific prefs of notifications. |
56 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* prefs); | 56 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* prefs); |
57 | 57 |
58 DesktopNotificationService(Profile* profile, | 58 DesktopNotificationService(Profile* profile, |
59 NotificationUIManager* ui_manager); | 59 NotificationUIManager* ui_manager); |
60 virtual ~DesktopNotificationService(); | 60 virtual ~DesktopNotificationService(); |
61 | 61 |
62 // Requests permission (using an info-bar) for a given origin. | 62 // Requests permission (using an info-bar) for a given origin. |
63 // |callback_context| contains an opaque value to pass back to the | 63 // |callback_context| contains an opaque value to pass back to the |
64 // requesting process when the info-bar finishes. | 64 // requesting process when the info-bar finishes. |
65 void RequestPermission(const GURL& origin, | 65 void RequestPermission(const GURL& origin, |
66 int process_id, | 66 int process_id, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // On-memory data for the availability of sync notifiers. | 221 // On-memory data for the availability of sync notifiers. |
222 std::set<std::string> enabled_sync_notifier_ids_; | 222 std::set<std::string> enabled_sync_notifier_ids_; |
223 | 223 |
224 // Registrar for the other kind of notifications (event signaling). | 224 // Registrar for the other kind of notifications (event signaling). |
225 content::NotificationRegistrar registrar_; | 225 content::NotificationRegistrar registrar_; |
226 | 226 |
227 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); | 227 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); |
228 }; | 228 }; |
229 | 229 |
230 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 230 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
OLD | NEW |