| 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> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 24 | 24 |
| 25 class ContentSettingsPattern; | 25 class ContentSettingsPattern; |
| 26 class Extension; | 26 class Extension; |
| 27 class Notification; | 27 class Notification; |
| 28 class NotificationDelegate; | 28 class NotificationDelegate; |
| 29 class NotificationUIManager; | 29 class NotificationUIManager; |
| 30 class PrefService; | 30 class PrefService; |
| 31 class Profile; | 31 class Profile; |
| 32 class TabContents; | 32 class TabContents; |
| 33 struct DesktopNotificationHostMsg_Show_Params; | 33 |
| 34 namespace content { |
| 35 struct ShowDesktopNotificationHostMsgParams; |
| 36 } |
| 34 | 37 |
| 35 // The DesktopNotificationService is an object, owned by the Profile, | 38 // The DesktopNotificationService is an object, owned by the Profile, |
| 36 // which provides the creation of desktop "toasts" to web pages and workers. | 39 // which provides the creation of desktop "toasts" to web pages and workers. |
| 37 class DesktopNotificationService : public content::NotificationObserver, | 40 class DesktopNotificationService : public content::NotificationObserver, |
| 38 public ProfileKeyedService { | 41 public ProfileKeyedService { |
| 39 public: | 42 public: |
| 40 enum DesktopNotificationSource { | 43 enum DesktopNotificationSource { |
| 41 PageNotification, | 44 PageNotification, |
| 42 WorkerNotification | 45 WorkerNotification |
| 43 }; | 46 }; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 58 int process_id, | 61 int process_id, |
| 59 int route_id, | 62 int route_id, |
| 60 int callback_context, | 63 int callback_context, |
| 61 TabContents* tab); | 64 TabContents* tab); |
| 62 | 65 |
| 63 // ShowNotification is called on the UI thread handling IPCs from a child | 66 // ShowNotification is called on the UI thread handling IPCs from a child |
| 64 // process, identified by |process_id| and |route_id|. |source| indicates | 67 // process, identified by |process_id| and |route_id|. |source| indicates |
| 65 // whether the script is in a worker or page. |params| contains all the | 68 // whether the script is in a worker or page. |params| contains all the |
| 66 // other parameters supplied by the worker or page. | 69 // other parameters supplied by the worker or page. |
| 67 bool ShowDesktopNotification( | 70 bool ShowDesktopNotification( |
| 68 const DesktopNotificationHostMsg_Show_Params& params, | 71 const content::ShowDesktopNotificationHostMsgParams& params, |
| 69 int process_id, int route_id, DesktopNotificationSource source); | 72 int process_id, int route_id, DesktopNotificationSource source); |
| 70 | 73 |
| 71 // Cancels a notification. If it has already been shown, it will be | 74 // Cancels a notification. If it has already been shown, it will be |
| 72 // removed from the screen. If it hasn't been shown yet, it won't be | 75 // removed from the screen. If it hasn't been shown yet, it won't be |
| 73 // shown. | 76 // shown. |
| 74 bool CancelDesktopNotification(int process_id, | 77 bool CancelDesktopNotification(int process_id, |
| 75 int route_id, | 78 int route_id, |
| 76 int notification_id); | 79 int notification_id); |
| 77 | 80 |
| 78 // Methods to setup and modify permission preferences. | 81 // Methods to setup and modify permission preferences. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Non-owned pointer to the notification manager which manages the | 148 // Non-owned pointer to the notification manager which manages the |
| 146 // UI for desktop toasts. | 149 // UI for desktop toasts. |
| 147 NotificationUIManager* ui_manager_; | 150 NotificationUIManager* ui_manager_; |
| 148 | 151 |
| 149 content::NotificationRegistrar notification_registrar_; | 152 content::NotificationRegistrar notification_registrar_; |
| 150 | 153 |
| 151 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); | 154 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); |
| 152 }; | 155 }; |
| 153 | 156 |
| 154 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 157 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
| OLD | NEW |