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

Side by Side Diff: public/platform/modules/permissions/WebPermissionClient.h

Issue 1236003004: blink: permissions: add plumbing to request permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@permissions
Patch Set: Rebase Created 5 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 WebPermissionClient_h 5 #ifndef WebPermissionClient_h
6 #define WebPermissionClient_h 6 #define WebPermissionClient_h
7 7
8 #include "public/platform/WebCallbacks.h" 8 #include "public/platform/WebCallbacks.h"
9 #include "public/platform/modules/permissions/WebPermissionStatus.h" 9 #include "public/platform/modules/permissions/WebPermissionStatus.h"
10 #include "public/platform/modules/permissions/WebPermissionType.h" 10 #include "public/platform/modules/permissions/WebPermissionType.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 using WebPermissionCallback = WebCallbacks<WebPermissionStatus*, void>; 14 using WebPermissionCallback = WebCallbacks<WebPermissionStatus*, void>;
15 15
16 class WebPermissionObserver; 16 class WebPermissionObserver;
17 class WebURL; 17 class WebURL;
18 18
19 // This client is expected to do general permission handling. From simple 19 // This client is expected to do general permission handling. From simple
20 // permission query to requesting new permissions. 20 // permission query to requesting new permissions.
21 class WebPermissionClient { 21 class WebPermissionClient {
22 public: 22 public:
23 // Query the permission status of a given origin for a specific permission. 23 // Query the permission status of a given origin for a specific permission.
24 virtual void queryPermission(WebPermissionType, const WebURL&, WebPermission Callback*) { } 24 virtual void queryPermission(WebPermissionType, const WebURL&, WebPermission Callback*) { }
25 25
26 // Request a specific permission for a given origin.
27 virtual void requestPermission(WebPermissionType, const WebURL&, WebPermissi onCallback*) { }
28
26 // Revoke a specific permission for a given origin. 29 // Revoke a specific permission for a given origin.
27 virtual void revokePermission(WebPermissionType, const WebURL&, WebPermissio nCallback*) { } 30 virtual void revokePermission(WebPermissionType, const WebURL&, WebPermissio nCallback*) { }
28 31
29 // Listen for permission changes for a given origin and inform the observer 32 // Listen for permission changes for a given origin and inform the observer
30 // when they happen. The observer is not owned by the WebPermissionClient. 33 // when they happen. The observer is not owned by the WebPermissionClient.
31 // The client should expect stopListening() to be called when the observer 34 // The client should expect stopListening() to be called when the observer
32 // will be destroyed. 35 // will be destroyed.
33 virtual void startListening(WebPermissionType, const WebURL&, WebPermissionO bserver*) { } 36 virtual void startListening(WebPermissionType, const WebURL&, WebPermissionO bserver*) { }
34 37
35 // Stop listening to all the permission changes associated with the given 38 // Stop listening to all the permission changes associated with the given
36 // observer. 39 // observer.
37 virtual void stopListening(WebPermissionObserver*) { } 40 virtual void stopListening(WebPermissionObserver*) { }
38 41
39 protected: 42 protected:
40 virtual ~WebPermissionClient() { } 43 virtual ~WebPermissionClient() { }
41 }; 44 };
42 45
43 } // namespace blink 46 } // namespace blink
44 47
45 #endif // WebPermissionClient_h 48 #endif // WebPermissionClient_h
OLDNEW
« Source/core/frame/UseCounter.h ('K') | « Source/modules/permissions/Permissions.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698