Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(853)

Side by Side Diff: public/platform/WebNotificationManager.h

Issue 872313003: Move Notification-related Blink API headers into their own directory. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 #include "public/platform/modules/notifications/WebNotificationManager.h"
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 WebNotificationManager_h
6 #define WebNotificationManager_h
7
8 #include "WebCallbacks.h"
9 #include "WebNotificationPermission.h"
10
11 namespace blink {
12
13 struct WebNotificationData;
14 class WebNotificationDelegate;
15 class WebSerializedOrigin;
16 class WebServiceWorkerRegistration;
17 class WebString;
18
19 using WebNotificationShowCallbacks = WebCallbacks<void, void>;
20
21 // Provides the services to show platform notifications to the user.
22 class WebNotificationManager {
23 public:
24 virtual ~WebNotificationManager() { }
25
26 // Shows a page notification on the user's system. These notifications will have their
27 // events delivered to the delegate specified in this call.
28 virtual void show(const WebSerializedOrigin&, const WebNotificationData&, We bNotificationDelegate*) = 0;
29
30 // Shows a persistent notification on the user's system. These notifications will have
31 // their events delivered to a Service Worker rather than the object's deleg ate. Will
32 // take ownership of the WebNotificationShowCallbacks object.
33 virtual void showPersistent(const WebSerializedOrigin&, const WebNotificatio nData&, WebServiceWorkerRegistration*, WebNotificationShowCallbacks*) { }
34
35 // Closes a notification previously shown, and removes it if being shown.
36 virtual void close(WebNotificationDelegate*) = 0;
37
38 // Closes a persistent notification identified by its persistent notificatio n Id.
39 virtual void closePersistent(const WebString& persistentNotificationId) { }
40
41 // Indicates that the delegate object is being destroyed, and must no longer
42 // be used by the embedder to dispatch events.
43 virtual void notifyDelegateDestroyed(WebNotificationDelegate*) = 0;
44
45 // Synchronously checks the permission level for the given origin.
46 virtual WebNotificationPermission checkPermission(const WebSerializedOrigin& ) = 0;
47 };
48
49 } // namespace blink
50
51 #endif // WebNotificationManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698