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 virtual ~ChromeWebViewPermissionHelperDelegate(); |
21 | 21 |
22 // WebViewPermissionHelperDelegate implementation. | 22 // WebViewPermissionHelperDelegate implementation. |
23 virtual void CanDownload( | 23 virtual void CanDownload( |
24 content::RenderViewHost* render_view_host, | 24 content::RenderViewHost* render_view_host, |
25 const GURL& url, | 25 const GURL& url, |
26 const std::string& request_method, | 26 const std::string& request_method, |
27 const base::Callback<void(bool)>& callback) OVERRIDE; | 27 const base::Callback<void(bool)>& callback) override; |
28 virtual void RequestPointerLockPermission( | 28 virtual void RequestPointerLockPermission( |
29 bool user_gesture, | 29 bool user_gesture, |
30 bool last_unlocked_by_target, | 30 bool last_unlocked_by_target, |
31 const base::Callback<void(bool)>& callback) OVERRIDE; | 31 const base::Callback<void(bool)>& callback) override; |
32 virtual void RequestGeolocationPermission( | 32 virtual void RequestGeolocationPermission( |
33 int bridge_id, | 33 int bridge_id, |
34 const GURL& requesting_frame, | 34 const GURL& requesting_frame, |
35 bool user_gesture, | 35 bool user_gesture, |
36 const base::Callback<void(bool)>& callback) OVERRIDE; | 36 const base::Callback<void(bool)>& callback) override; |
37 virtual void CancelGeolocationPermissionRequest(int bridge_id) OVERRIDE; | 37 virtual void CancelGeolocationPermissionRequest(int bridge_id) override; |
38 virtual void RequestFileSystemPermission( | 38 virtual void RequestFileSystemPermission( |
39 const GURL& url, | 39 const GURL& url, |
40 bool allowed_by_default, | 40 bool allowed_by_default, |
41 const base::Callback<void(bool)>& callback) OVERRIDE; | 41 const base::Callback<void(bool)>& callback) override; |
42 virtual void FileSystemAccessedAsync( | 42 virtual void FileSystemAccessedAsync( |
43 int render_process_id, | 43 int render_process_id, |
44 int render_frame_id, | 44 int render_frame_id, |
45 int request_id, | 45 int request_id, |
46 const GURL& url, | 46 const GURL& url, |
47 bool blocked_by_policy) OVERRIDE; | 47 bool blocked_by_policy) override; |
48 virtual void FileSystemAccessedSync( | 48 virtual void FileSystemAccessedSync( |
49 int render_process_id, | 49 int render_process_id, |
50 int render_frame_id, | 50 int render_frame_id, |
51 const GURL& url, | 51 const GURL& url, |
52 bool blocked_by_policy, | 52 bool blocked_by_policy, |
53 IPC::Message* reply_msg) OVERRIDE; | 53 IPC::Message* reply_msg) override; |
54 #if defined(ENABLE_PLUGINS) | 54 #if defined(ENABLE_PLUGINS) |
55 // content::WebContentsObserver implementation. | 55 // content::WebContentsObserver implementation. |
56 virtual bool OnMessageReceived( | 56 virtual bool OnMessageReceived( |
57 const IPC::Message& message, | 57 const IPC::Message& message, |
58 content::RenderFrameHost* render_frame_host) OVERRIDE; | 58 content::RenderFrameHost* render_frame_host) override; |
59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 59 virtual bool OnMessageReceived(const IPC::Message& message) override; |
60 #endif // defined(ENABLE_PLUGINS) | 60 #endif // defined(ENABLE_PLUGINS) |
61 | 61 |
62 private: | 62 private: |
63 #if defined(ENABLE_PLUGINS) | 63 #if defined(ENABLE_PLUGINS) |
64 // Message handlers: | 64 // Message handlers: |
65 void OnBlockedUnauthorizedPlugin(const base::string16& name, | 65 void OnBlockedUnauthorizedPlugin(const base::string16& name, |
66 const std::string& identifier); | 66 const std::string& identifier); |
67 void OnCouldNotLoadPlugin(const base::FilePath& plugin_path); | 67 void OnCouldNotLoadPlugin(const base::FilePath& plugin_path); |
68 void OnBlockedOutdatedPlugin(int placeholder_id, | 68 void OnBlockedOutdatedPlugin(int placeholder_id, |
69 const std::string& identifier); | 69 const std::string& identifier); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 std::map<int, int> bridge_id_to_request_id_map_; | 126 std::map<int, int> bridge_id_to_request_id_map_; |
127 | 127 |
128 base::WeakPtrFactory<ChromeWebViewPermissionHelperDelegate> weak_factory_; | 128 base::WeakPtrFactory<ChromeWebViewPermissionHelperDelegate> weak_factory_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewPermissionHelperDelegate); | 130 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewPermissionHelperDelegate); |
131 }; | 131 }; |
132 | 132 |
133 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_
DELEGATE_H_ | 133 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_PERMISSION_HELPER_
DELEGATE_H_ |
OLD | NEW |