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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_permission_helper_delegate.h

Issue 468323002: Introduce WebViewPermissionHelperDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up WebViewPermissionHelper. Created 6 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
(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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIWE_PERMISSION_HELPER_DELEGA TE_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIWE_PERMISSION_HELPER_DELEGA TE_H_
7
8 #include "base/memory/weak_ptr.h"
Fady Samuel 2014/08/13 20:07:25 Is this necessary?
Xi Han 2014/08/13 21:30:57 Removed.
9 #include "content/public/browser/web_contents.h"
10 #include "content/public/browser/web_contents_observer.h"
11 #include "content/public/common/media_stream_request.h"
12
13 namespace extensions {
14
15 class WebViewPermissionHelperDelegate : public content::WebContentsObserver {
16 public:
17 explicit WebViewPermissionHelperDelegate(content::WebContents* contents);
18 virtual ~WebViewPermissionHelperDelegate();
19
20 virtual void RequestMediaAccessPermission(
21 content::WebContents* source,
22 const content::MediaStreamRequest& request,
23 const content::MediaResponseCallback& callback) {}
Fady Samuel 2014/08/13 20:07:25 I think the usual convention is for interfaces, th
Xi Han 2014/08/13 21:30:57 Thank you for pointing out this.
24 virtual void CanDownload(
25 content::RenderViewHost* render_view_host,
26 const GURL& url,
27 const std::string& request_method,
28 const base::Callback<void(bool)>& callback) {}
29 virtual void RequestPointerLockPermission(
30 bool user_gesture,
31 bool last_unlocked_by_target,
32 const base::Callback<void(bool)>& callback) {}
33
34 // Requests Geolocation Permission from the embedder.
35 virtual void RequestGeolocationPermission(
36 int bridge_id,
37 const GURL& requesting_frame,
38 bool user_gesture,
39 const base::Callback<void(bool)>& callback) {}
40 virtual void CancelGeolocationPermissionRequest(int bridge_id) {}
41
42 virtual void RequestFileSystemPermission(
43 const GURL& url,
44 bool allowed_by_default,
45 const base::Callback<void(bool)>& callback) {}
46
47 // Called when file system access is requested by the guest content using the
48 // asynchronous HTML5 file system API. The request is plumbed through the
49 // <webview> permission request API. The request will be:
50 // - Allowed if the embedder explicitly allowed it.
51 // - Denied if the embedder explicitly denied.
52 // - Determined by the guest's content settings if the embedder does not
53 // perform an explicit action.
54 // If access was blocked due to the page's content settings,
55 // |blocked_by_policy| should be true, and this function should invoke
56 // OnContentBlocked.
57 virtual void FileSystemAccessedAsync(
58 int render_process_id,
59 int render_frame_id,
60 int request_id,
61 const GURL& url,
62 bool blocked_by_policy) {}
63
64 // Called when file system access is requested by the guest content using the
65 // synchronous HTML5 file system API in a worker thread or shared worker. The
66 // request is plumbed through the <webview> permission request API. The
67 // request will be:
68 // - Allowed if the embedder explicitly allowed it.
69 // - Denied if the embedder explicitly denied.
70 // - Determined by the guest's content settings if the embedder does not
71 // perform an explicit action.
72 // If access was blocked due to the page's content settings,
73 // |blocked_by_policy| should be true, and this function should invoke
74 // OnContentBlocked.
75 virtual void FileSystemAccessedSync(
76 int render_process_id,
77 int render_frame_id,
78 const GURL& url,
79 bool blocked_by_policy,
80 IPC::Message* reply_msg) {}
81
82 private:
83 DISALLOW_COPY_AND_ASSIGN(WebViewPermissionHelperDelegate);
84 };
85
86 } // namespace extensions
87
88 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIWE_PERMISSION_HELPER_DEL EGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698