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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void ShowContextMenu( | 67 void ShowContextMenu( |
68 int request_id, | 68 int request_id, |
69 const WebViewGuestDelegate::MenuItemVector* items); | 69 const WebViewGuestDelegate::MenuItemVector* items); |
70 | 70 |
71 // Sets the frame name of the guest. | 71 // Sets the frame name of the guest. |
72 void SetName(const std::string& name); | 72 void SetName(const std::string& name); |
73 | 73 |
74 // Set the zoom factor. | 74 // Set the zoom factor. |
75 void SetZoom(double zoom_factor); | 75 void SetZoom(double zoom_factor); |
76 | 76 |
| 77 // Sets the transparency of the guest. |
| 78 void SetAllowTransparency(bool allow); |
| 79 |
77 // GuestViewBase implementation. | 80 // GuestViewBase implementation. |
78 virtual const char* GetAPINamespace() const OVERRIDE; | 81 virtual const char* GetAPINamespace() const OVERRIDE; |
79 virtual int GetTaskPrefix() const OVERRIDE; | 82 virtual int GetTaskPrefix() const OVERRIDE; |
80 virtual void CreateWebContents( | 83 virtual void CreateWebContents( |
81 const std::string& embedder_extension_id, | 84 const std::string& embedder_extension_id, |
82 int embedder_render_process_id, | 85 int embedder_render_process_id, |
83 const base::DictionaryValue& create_params, | 86 const base::DictionaryValue& create_params, |
84 const WebContentsCreatedCallback& callback) OVERRIDE; | 87 const WebContentsCreatedCallback& callback) OVERRIDE; |
85 virtual void DidAttachToEmbedder() OVERRIDE; | 88 virtual void DidAttachToEmbedder() OVERRIDE; |
86 virtual void DidInitialize() OVERRIDE; | 89 virtual void DidInitialize() OVERRIDE; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 scoped_ptr<ScriptExecutor> script_executor_; | 326 scoped_ptr<ScriptExecutor> script_executor_; |
324 | 327 |
325 content::NotificationRegistrar notification_registrar_; | 328 content::NotificationRegistrar notification_registrar_; |
326 | 329 |
327 // True if the user agent is overridden. | 330 // True if the user agent is overridden. |
328 bool is_overriding_user_agent_; | 331 bool is_overriding_user_agent_; |
329 | 332 |
330 // Stores the window name of the main frame of the guest. | 333 // Stores the window name of the main frame of the guest. |
331 std::string name_; | 334 std::string name_; |
332 | 335 |
| 336 // Stores whether the contents of the guest can be transparent. |
| 337 bool guest_opaque_; |
| 338 |
333 // Handles the JavaScript dialog requests. | 339 // Handles the JavaScript dialog requests. |
334 JavaScriptDialogHelper javascript_dialog_helper_; | 340 JavaScriptDialogHelper javascript_dialog_helper_; |
335 | 341 |
336 // Handels permission requests. | 342 // Handels permission requests. |
337 scoped_ptr<WebViewPermissionHelper> web_view_permission_helper_; | 343 scoped_ptr<WebViewPermissionHelper> web_view_permission_helper_; |
338 | 344 |
339 scoped_ptr<WebViewGuestDelegate> web_view_guest_delegate_; | 345 scoped_ptr<WebViewGuestDelegate> web_view_guest_delegate_; |
340 | 346 |
341 // Tracks the name, and target URL of the new window. Once the first | 347 // Tracks the name, and target URL of the new window. Once the first |
342 // navigation commits, we no longer track this information. | 348 // navigation commits, we no longer track this information. |
343 struct NewWindowInfo { | 349 struct NewWindowInfo { |
344 GURL url; | 350 GURL url; |
345 std::string name; | 351 std::string name; |
346 bool changed; | 352 bool changed; |
347 NewWindowInfo(const GURL& url, const std::string& name) : | 353 NewWindowInfo(const GURL& url, const std::string& name) : |
348 url(url), | 354 url(url), |
349 name(name), | 355 name(name), |
350 changed(false) {} | 356 changed(false) {} |
351 }; | 357 }; |
352 | 358 |
353 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; | 359 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; |
354 PendingWindowMap pending_new_windows_; | 360 PendingWindowMap pending_new_windows_; |
355 | 361 |
356 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 362 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
357 }; | 363 }; |
358 | 364 |
359 } // namespace extensions | 365 } // namespace extensions |
360 | 366 |
361 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 367 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
OLD | NEW |