| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 |
| 10 #include <memory> |
| 9 #include <set> | 11 #include <set> |
| 10 #include <string> | 12 #include <string> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 16 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onPermission.h" | 17 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onPermission.h" |
| 17 | 18 |
| 18 class GURL; | 19 class GURL; |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 class BrowserContext; | 23 class BrowserContext; |
| 23 class DesktopNotificationDelegate; | 24 class DesktopNotificationDelegate; |
| 24 struct NotificationResources; | 25 struct NotificationResources; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 50 int render_process_id) = 0; | 51 int render_process_id) = 0; |
| 51 | 52 |
| 52 // Displays the notification described in |notification_data| to the user. A | 53 // Displays the notification described in |notification_data| to the user. A |
| 53 // closure through which the notification can be closed will be stored in the | 54 // closure through which the notification can be closed will be stored in the |
| 54 // |cancel_callback| argument. This method must be called on the UI thread. | 55 // |cancel_callback| argument. This method must be called on the UI thread. |
| 55 virtual void DisplayNotification( | 56 virtual void DisplayNotification( |
| 56 BrowserContext* browser_context, | 57 BrowserContext* browser_context, |
| 57 const GURL& origin, | 58 const GURL& origin, |
| 58 const PlatformNotificationData& notification_data, | 59 const PlatformNotificationData& notification_data, |
| 59 const NotificationResources& notification_resources, | 60 const NotificationResources& notification_resources, |
| 60 scoped_ptr<DesktopNotificationDelegate> delegate, | 61 std::unique_ptr<DesktopNotificationDelegate> delegate, |
| 61 base::Closure* cancel_callback) = 0; | 62 base::Closure* cancel_callback) = 0; |
| 62 | 63 |
| 63 // Displays the persistent notification described in |notification_data| to | 64 // Displays the persistent notification described in |notification_data| to |
| 64 // the user. This method must be called on the UI thread. | 65 // the user. This method must be called on the UI thread. |
| 65 virtual void DisplayPersistentNotification( | 66 virtual void DisplayPersistentNotification( |
| 66 BrowserContext* browser_context, | 67 BrowserContext* browser_context, |
| 67 int64_t persistent_notification_id, | 68 int64_t persistent_notification_id, |
| 68 const GURL& origin, | 69 const GURL& origin, |
| 69 const PlatformNotificationData& notification_data, | 70 const PlatformNotificationData& notification_data, |
| 70 const NotificationResources& notification_resources) = 0; | 71 const NotificationResources& notification_resources) = 0; |
| 71 | 72 |
| 72 // Closes the persistent notification identified by | 73 // Closes the persistent notification identified by |
| 73 // |persistent_notification_id|. This method must be called on the UI thread. | 74 // |persistent_notification_id|. This method must be called on the UI thread. |
| 74 virtual void ClosePersistentNotification( | 75 virtual void ClosePersistentNotification( |
| 75 BrowserContext* browser_context, | 76 BrowserContext* browser_context, |
| 76 int64_t persistent_notification_id) = 0; | 77 int64_t persistent_notification_id) = 0; |
| 77 | 78 |
| 78 // Writes the ids of all currently displaying persistent notifications for the | 79 // Writes the ids of all currently displaying persistent notifications for the |
| 79 // given |browser_context| to |displayed_notifications|. Returns whether the | 80 // given |browser_context| to |displayed_notifications|. Returns whether the |
| 80 // platform is able to provide such a set. | 81 // platform is able to provide such a set. |
| 81 virtual bool GetDisplayedPersistentNotifications( | 82 virtual bool GetDisplayedPersistentNotifications( |
| 82 BrowserContext* browser_context, | 83 BrowserContext* browser_context, |
| 83 std::set<std::string>* displayed_notifications) = 0; | 84 std::set<std::string>* displayed_notifications) = 0; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace content | 87 } // namespace content |
| 87 | 88 |
| 88 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ | 89 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| OLD | NEW |