Index: extensions/browser/guest_view/web_view/web_view_guest.cc |
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc |
index d7afe16ea47a01312c45f9498b739d538c2c38f5..3c1102f923c5f6a8a659ba78142e843c128f63b6 100644 |
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc |
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc |
@@ -18,6 +18,7 @@ |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/render_view_host.h" |
+#include "content/public/browser/render_widget_host_view.h" |
#include "content/public/browser/resource_request_details.h" |
#include "content/public/browser/site_instance.h" |
#include "content/public/browser/storage_partition.h" |
@@ -243,8 +244,13 @@ void WebViewGuest::CreateWebContents( |
void WebViewGuest::DidAttachToEmbedder() { |
SetUpAutoSize(); |
+ bool allow_transparency = false; |
+ attach_params()->GetBoolean(webview::kAttributeAllowTransparency, |
+ &allow_transparency); |
+ SetAllowTransparency(allow_transparency); |
+ |
std::string name; |
- if (attach_params()->GetString(webview::kName, &name)) { |
+ if (attach_params()->GetString(webview::kAttributeName, &name)) { |
// If the guest window's name is empty, then the WebView tag's name is |
// assigned. Otherwise, the guest window's name takes precedence over the |
// WebView tag's name. |
@@ -262,7 +268,7 @@ void WebViewGuest::DidAttachToEmbedder() { |
} |
std::string src; |
- if (attach_params()->GetString("src", &src) && !src.empty()) |
+ if (attach_params()->GetString(webview::kAttributeSrc, &src) && !src.empty()) |
NavigateGuest(src); |
if (GetOpener()) { |
@@ -955,6 +961,10 @@ void WebViewGuest::SetZoom(double zoom_factor) { |
web_view_guest_delegate_->OnSetZoom(zoom_factor); |
} |
+void WebViewGuest::SetAllowTransparency(bool allow) { |
+ web_contents()->GetRenderViewHost()->GetView()->SetBackgroundOpaque(!allow); |
+} |
+ |
void WebViewGuest::AddNewContents(content::WebContents* source, |
content::WebContents* new_contents, |
WindowOpenDisposition disposition, |