Chromium Code Reviews| 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. This method | |
| 37 // must be called on the UI thread. | |
| 38 virtual void DisplayNotification( | |
| 39 BrowserContext* browser_context, | |
| 40 const ShowDesktopNotificationHostMsgParams& params, | |
| 41 scoped_ptr<DesktopNotificationDelegate> delegate, | |
| 42 int render_process_id, | |
| 43 base::Closure* cancel_callback) = 0; | |
|
dewittj
2014/12/02 17:22:59
It's unclear that this is an outparam, can you doc
Peter Beverloo
2014/12/05 20:03:43
I've documented it in the comment. I don't think t
| |
| 44 }; | |
| 45 | |
| 46 } // namespace content | |
| 47 | |
| 48 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ | |
| OLD | NEW |