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 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 "content/public/browser/web_contents.h" | |
9 #include "content/public/browser/web_contents_observer.h" | |
10 #include "content/public/common/media_stream_request.h" | |
11 | |
12 namespace extensions { | |
13 | |
14 class WebViewPermissionHelperDelegate : public content::WebContentsObserver { | |
Fady Samuel
2014/08/13 23:24:50
Short comment describing what this is and what thi
Xi Han
2014/08/14 13:59:54
Done.
| |
15 public: | |
16 explicit WebViewPermissionHelperDelegate(content::WebContents* contents); | |
17 virtual ~WebViewPermissionHelperDelegate(); | |
18 | |
19 virtual void RequestMediaAccessPermission( | |
20 content::WebContents* source, | |
21 const content::MediaStreamRequest& request, | |
22 const content::MediaResponseCallback& callback) {} | |
23 | |
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 | |
30 virtual void RequestPointerLockPermission( | |
31 bool user_gesture, | |
32 bool last_unlocked_by_target, | |
33 const base::Callback<void(bool)>& callback) {} | |
34 | |
35 // Requests Geolocation Permission from the embedder. | |
36 virtual void RequestGeolocationPermission( | |
37 int bridge_id, | |
38 const GURL& requesting_frame, | |
39 bool user_gesture, | |
40 const base::Callback<void(bool)>& callback) {} | |
41 | |
42 virtual void CancelGeolocationPermissionRequest(int bridge_id) {} | |
43 | |
44 virtual void RequestFileSystemPermission( | |
45 const GURL& url, | |
46 bool allowed_by_default, | |
47 const base::Callback<void(bool)>& callback) {} | |
48 | |
49 // Called when file system access is requested by the guest content using the | |
50 // asynchronous HTML5 file system API. The request is plumbed through the | |
51 // <webview> permission request API. The request will be: | |
52 // - Allowed if the embedder explicitly allowed it. | |
53 // - Denied if the embedder explicitly denied. | |
54 // - Determined by the guest's content settings if the embedder does not | |
55 // perform an explicit action. | |
56 // If access was blocked due to the page's content settings, | |
57 // |blocked_by_policy| should be true, and this function should invoke | |
58 // OnContentBlocked. | |
59 virtual void FileSystemAccessedAsync( | |
60 int render_process_id, | |
61 int render_frame_id, | |
62 int request_id, | |
63 const GURL& url, | |
64 bool blocked_by_policy) {} | |
65 | |
66 // Called when file system access is requested by the guest content using the | |
67 // synchronous HTML5 file system API in a worker thread or shared worker. The | |
68 // request is plumbed through the <webview> permission request API. The | |
69 // request will be: | |
70 // - Allowed if the embedder explicitly allowed it. | |
71 // - Denied if the embedder explicitly denied. | |
72 // - Determined by the guest's content settings if the embedder does not | |
73 // perform an explicit action. | |
74 // If access was blocked due to the page's content settings, | |
75 // |blocked_by_policy| should be true, and this function should invoke | |
76 // OnContentBlocked. | |
77 virtual void FileSystemAccessedSync( | |
78 int render_process_id, | |
79 int render_frame_id, | |
80 const GURL& url, | |
81 bool blocked_by_policy, | |
82 IPC::Message* reply_msg) {} | |
83 | |
84 private: | |
85 DISALLOW_COPY_AND_ASSIGN(WebViewPermissionHelperDelegate); | |
86 }; | |
87 | |
88 } // namespace extensions | |
89 | |
90 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIWE_PERMISSION_HELPER_DEL EGATE_H_ | |
OLD | NEW |