OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 5 #ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
6 #define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 6 #define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
7 | 7 |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "chrome/browser/extensions/tab_helper.h" | 9 #include "chrome/browser/extensions/tab_helper.h" |
10 #include "chrome/browser/guestview/guestview.h" | 10 #include "chrome/browser/guestview/guestview.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 virtual void GuestProcessGone(base::TerminationStatus status) OVERRIDE; | 66 virtual void GuestProcessGone(base::TerminationStatus status) OVERRIDE; |
67 virtual bool HandleKeyboardEvent( | 67 virtual bool HandleKeyboardEvent( |
68 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 68 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
69 virtual bool IsDragAndDropEnabled() OVERRIDE; | 69 virtual bool IsDragAndDropEnabled() OVERRIDE; |
70 virtual bool IsOverridingUserAgent() const OVERRIDE; | 70 virtual bool IsOverridingUserAgent() const OVERRIDE; |
71 virtual void LoadAbort(bool is_top_level, | 71 virtual void LoadAbort(bool is_top_level, |
72 const GURL& url, | 72 const GURL& url, |
73 const std::string& error_type) OVERRIDE; | 73 const std::string& error_type) OVERRIDE; |
74 virtual void RendererResponsive() OVERRIDE; | 74 virtual void RendererResponsive() OVERRIDE; |
75 virtual void RendererUnresponsive() OVERRIDE; | 75 virtual void RendererUnresponsive() OVERRIDE; |
76 virtual bool RequestPermission( | 76 virtual void RequestPermission( |
77 BrowserPluginPermissionType permission_type, | 77 BrowserPluginPermissionType permission_type, |
78 const base::DictionaryValue& request_info, | 78 const base::DictionaryValue& request_info, |
79 const PermissionResponseCallback& callback, | 79 const PermissionResponseCallback& callback, |
80 bool allowed_by_default) OVERRIDE; | 80 bool allowed_by_default) OVERRIDE; |
81 virtual GURL ResolveURL(const std::string& src) OVERRIDE; | 81 virtual GURL ResolveURL(const std::string& src) OVERRIDE; |
82 virtual void SizeChanged(const gfx::Size& old_size, const gfx::Size& new_size) | 82 virtual void SizeChanged(const gfx::Size& old_size, const gfx::Size& new_size) |
83 OVERRIDE; | 83 OVERRIDE; |
84 | 84 |
85 // NotificationObserver implementation. | 85 // NotificationObserver implementation. |
86 virtual void Observe(int type, | 86 virtual void Observe(int type, |
(...skipping 14 matching lines...) Expand all Loading... |
101 // Conclude a find request to clear highlighting. | 101 // Conclude a find request to clear highlighting. |
102 void StopFinding(content::StopFindAction); | 102 void StopFinding(content::StopFindAction); |
103 | 103 |
104 // If possible, navigate the guest to |relative_index| entries away from the | 104 // If possible, navigate the guest to |relative_index| entries away from the |
105 // current navigation entry. | 105 // current navigation entry. |
106 void Go(int relative_index); | 106 void Go(int relative_index); |
107 | 107 |
108 // Reload the guest. | 108 // Reload the guest. |
109 void Reload(); | 109 void Reload(); |
110 | 110 |
| 111 // Requests Geolocation Permission from the embedder. |
| 112 void RequestGeolocationPermission(int bridge_id, |
| 113 const GURL& requesting_frame, |
| 114 bool user_gesture, |
| 115 const base::Callback<void(bool)>& callback); |
| 116 |
| 117 void OnWebViewGeolocationPermissionResponse( |
| 118 int bridge_id, |
| 119 bool user_gesture, |
| 120 const base::Callback<void(bool)>& callback, |
| 121 bool allow, |
| 122 const std::string& user_input); |
| 123 |
| 124 void CancelGeolocationPermissionRequest(int bridge_id); |
| 125 |
111 enum PermissionResponseAction { | 126 enum PermissionResponseAction { |
112 DENY, | 127 DENY, |
113 ALLOW, | 128 ALLOW, |
114 DEFAULT | 129 DEFAULT |
115 }; | 130 }; |
116 | 131 |
117 enum SetPermissionResult { | 132 enum SetPermissionResult { |
118 SET_PERMISSION_INVALID, | 133 SET_PERMISSION_INVALID, |
119 SET_PERMISSION_ALLOWED, | 134 SET_PERMISSION_ALLOWED, |
120 SET_PERMISSION_DENIED | 135 SET_PERMISSION_DENIED |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 content::WebContents* web_contents); | 227 content::WebContents* web_contents); |
213 | 228 |
214 #if defined(OS_CHROMEOS) | 229 #if defined(OS_CHROMEOS) |
215 // Notification of a change in the state of an accessibility setting. | 230 // Notification of a change in the state of an accessibility setting. |
216 void OnAccessibilityStatusChanged( | 231 void OnAccessibilityStatusChanged( |
217 const chromeos::AccessibilityStatusEventDetails& details); | 232 const chromeos::AccessibilityStatusEventDetails& details); |
218 #endif | 233 #endif |
219 | 234 |
220 void InjectChromeVoxIfNeeded(content::RenderViewHost* render_view_host); | 235 void InjectChromeVoxIfNeeded(content::RenderViewHost* render_view_host); |
221 | 236 |
| 237 // Bridge IDs correspond to a geolocation request. This method will remove |
| 238 // the bookkeeping for a particular geolocation request associated with the |
| 239 // provided |bridge_id|. It returns the request ID of the geolocation request. |
| 240 int RemoveBridgeID(int bridge_id); |
| 241 |
| 242 int RequestPermissionInternal( |
| 243 BrowserPluginPermissionType permission_type, |
| 244 const base::DictionaryValue& request_info, |
| 245 const PermissionResponseCallback& callback, |
| 246 bool allowed_by_default); |
| 247 |
222 ObserverList<extensions::TabHelper::ScriptExecutionObserver> | 248 ObserverList<extensions::TabHelper::ScriptExecutionObserver> |
223 script_observers_; | 249 script_observers_; |
224 scoped_ptr<extensions::ScriptExecutor> script_executor_; | 250 scoped_ptr<extensions::ScriptExecutor> script_executor_; |
225 | 251 |
226 content::NotificationRegistrar notification_registrar_; | 252 content::NotificationRegistrar notification_registrar_; |
227 | 253 |
228 // A counter to generate a unique request id for a permission request. | 254 // A counter to generate a unique request id for a permission request. |
229 // We only need the ids to be unique for a given WebViewGuest. | 255 // We only need the ids to be unique for a given WebViewGuest. |
230 int next_permission_request_id_; | 256 int next_permission_request_id_; |
231 | 257 |
(...skipping 21 matching lines...) Expand all Loading... |
253 | 279 |
254 friend void WebviewFindHelper::DispatchFindUpdateEvent(bool canceled, | 280 friend void WebviewFindHelper::DispatchFindUpdateEvent(bool canceled, |
255 bool final_update); | 281 bool final_update); |
256 | 282 |
257 #if defined(OS_CHROMEOS) | 283 #if defined(OS_CHROMEOS) |
258 // Subscription to receive notifications on changes to a11y settings. | 284 // Subscription to receive notifications on changes to a11y settings. |
259 scoped_ptr<chromeos::AccessibilityStatusSubscription> | 285 scoped_ptr<chromeos::AccessibilityStatusSubscription> |
260 accessibility_subscription_; | 286 accessibility_subscription_; |
261 #endif | 287 #endif |
262 | 288 |
| 289 std::map<int, int> bridge_id_to_request_id_map_; |
| 290 |
263 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 291 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
264 }; | 292 }; |
265 | 293 |
266 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 294 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
OLD | NEW |