OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_DEL
EGATE_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_DEL
EGATE_H_ |
6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_DEL
EGATE_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_DEL
EGATE_H_ |
7 | 7 |
8 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 8 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
9 #include "extensions/browser/guest_view/web_view/web_view_permission_helper_dele
gate.h" | 9 #include "extensions/browser/guest_view/web_view/web_view_permission_helper_dele
gate.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 class WebViewGuest; | 12 class WebViewGuest; |
13 } | 13 } |
14 | 14 |
15 class ChromeWebViewPermissionHelperDelegate : | 15 class ChromeWebViewPermissionHelperDelegate : |
16 public extensions::WebViewPermissionHelperDelegate { | 16 public extensions::WebViewPermissionHelperDelegate { |
17 public: | 17 public: |
18 explicit ChromeWebViewPermissionHelperDelegate( | 18 explicit ChromeWebViewPermissionHelperDelegate( |
19 extensions::WebViewPermissionHelper* web_view_permission_helper); | 19 extensions::WebViewPermissionHelper* web_view_permission_helper); |
20 virtual ~ChromeWebViewPermissionHelperDelegate(); | 20 ~ChromeWebViewPermissionHelperDelegate() override; |
21 | 21 |
22 // WebViewPermissionHelperDelegate implementation. | 22 // WebViewPermissionHelperDelegate implementation. |
23 virtual void CanDownload( | 23 void CanDownload(content::RenderViewHost* render_view_host, |
24 content::RenderViewHost* render_view_host, | 24 const GURL& url, |
25 const GURL& url, | 25 const std::string& request_method, |
26 const std::string& request_method, | 26 const base::Callback<void(bool)>& callback) override; |
27 const base::Callback<void(bool)>& callback) override; | 27 void RequestPointerLockPermission( |
28 virtual void RequestPointerLockPermission( | |
29 bool user_gesture, | 28 bool user_gesture, |
30 bool last_unlocked_by_target, | 29 bool last_unlocked_by_target, |
31 const base::Callback<void(bool)>& callback) override; | 30 const base::Callback<void(bool)>& callback) override; |
32 virtual void RequestGeolocationPermission( | 31 void RequestGeolocationPermission( |
33 int bridge_id, | 32 int bridge_id, |
34 const GURL& requesting_frame, | 33 const GURL& requesting_frame, |
35 bool user_gesture, | 34 bool user_gesture, |
36 const base::Callback<void(bool)>& callback) override; | 35 const base::Callback<void(bool)>& callback) override; |
37 virtual void CancelGeolocationPermissionRequest(int bridge_id) override; | 36 void CancelGeolocationPermissionRequest(int bridge_id) override; |
38 virtual void RequestFileSystemPermission( | 37 void RequestFileSystemPermission( |
39 const GURL& url, | 38 const GURL& url, |
40 bool allowed_by_default, | 39 bool allowed_by_default, |
41 const base::Callback<void(bool)>& callback) override; | 40 const base::Callback<void(bool)>& callback) override; |
42 virtual void FileSystemAccessedAsync( | 41 void FileSystemAccessedAsync(int render_process_id, |
43 int render_process_id, | 42 int render_frame_id, |
44 int render_frame_id, | 43 int request_id, |
45 int request_id, | 44 const GURL& url, |
46 const GURL& url, | 45 bool blocked_by_policy) override; |
47 bool blocked_by_policy) override; | 46 void FileSystemAccessedSync(int render_process_id, |
48 virtual void FileSystemAccessedSync( | 47 int render_frame_id, |
49 int render_process_id, | 48 const GURL& url, |
50 int render_frame_id, | 49 bool blocked_by_policy, |
51 const GURL& url, | 50 IPC::Message* reply_msg) override; |
52 bool blocked_by_policy, | |
53 IPC::Message* reply_msg) override; | |
54 #if defined(ENABLE_PLUGINS) | 51 #if defined(ENABLE_PLUGINS) |
55 // content::WebContentsObserver implementation. | 52 // content::WebContentsObserver implementation. |
56 virtual bool OnMessageReceived( | 53 bool OnMessageReceived(const IPC::Message& message, |
57 const IPC::Message& message, | 54 content::RenderFrameHost* render_frame_host) override; |
58 content::RenderFrameHost* render_frame_host) override; | 55 bool OnMessageReceived(const IPC::Message& message) override; |
59 virtual bool OnMessageReceived(const IPC::Message& message) override; | |
60 #endif // defined(ENABLE_PLUGINS) | 56 #endif // defined(ENABLE_PLUGINS) |
61 | 57 |
62 private: | 58 private: |
63 #if defined(ENABLE_PLUGINS) | 59 #if defined(ENABLE_PLUGINS) |
64 // Message handlers: | 60 // Message handlers: |
65 void OnBlockedUnauthorizedPlugin(const base::string16& name, | 61 void OnBlockedUnauthorizedPlugin(const base::string16& name, |
66 const std::string& identifier); | 62 const std::string& identifier); |
67 void OnCouldNotLoadPlugin(const base::FilePath& plugin_path); | 63 void OnCouldNotLoadPlugin(const base::FilePath& plugin_path); |
68 void OnBlockedOutdatedPlugin(int placeholder_id, | 64 void OnBlockedOutdatedPlugin(int placeholder_id, |
69 const std::string& identifier); | 65 const std::string& identifier); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 120 } |
125 | 121 |
126 std::map<int, int> bridge_id_to_request_id_map_; | 122 std::map<int, int> bridge_id_to_request_id_map_; |
127 | 123 |
128 base::WeakPtrFactory<ChromeWebViewPermissionHelperDelegate> weak_factory_; | 124 base::WeakPtrFactory<ChromeWebViewPermissionHelperDelegate> weak_factory_; |
129 | 125 |
130 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewPermissionHelperDelegate); | 126 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewPermissionHelperDelegate); |
131 }; | 127 }; |
132 | 128 |
133 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_
DELEGATE_H_ | 129 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_
DELEGATE_H_ |
OLD | NEW |