OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "content/public/common/show_desktop_notification_params.h" |
| 12 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" |
| 13 |
| 14 class GURL; |
| 15 |
| 16 namespace content { |
| 17 |
| 18 class BrowserContext; |
| 19 class DesktopNotificationDelegate; |
| 20 class ResourceContext; |
| 21 |
| 22 // The service using which notifications can be presented to the user. There |
| 23 // should be a unique instance of the PlatformNotificationService depending |
| 24 // on the browsing context being used. |
| 25 class CONTENT_EXPORT PlatformNotificationService { |
| 26 public: |
| 27 virtual ~PlatformNotificationService() {} |
| 28 |
| 29 // Checks if |origin| has permission to display Web Notifications. This method |
| 30 // must be called on the IO thread. |
| 31 virtual blink::WebNotificationPermission CheckPermission( |
| 32 ResourceContext* resource_context, |
| 33 const GURL& origin, |
| 34 int render_process_id) = 0; |
| 35 |
| 36 // Displays the notification described in |params| to the user. A closure |
| 37 // through which the notification can be closed will be stored in the |
| 38 // |cancel_callback| argument. This method must be called on the UI thread. |
| 39 virtual void DisplayNotification( |
| 40 BrowserContext* browser_context, |
| 41 const ShowDesktopNotificationHostMsgParams& params, |
| 42 scoped_ptr<DesktopNotificationDelegate> delegate, |
| 43 int render_process_id, |
| 44 base::Closure* cancel_callback) = 0; |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
OLD | NEW |