Index: ui/views/controls/webview/webview.cc |
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc |
index 3e07f6f42322810d6eeceb809167c672b579d282..e7547d9ab65601277c07ecb5f22220ef66263e97 100644 |
--- a/ui/views/controls/webview/webview.cc |
+++ b/ui/views/controls/webview/webview.cc |
@@ -13,6 +13,7 @@ |
#include "ipc/ipc_message.h" |
#include "ui/accessibility/ax_enums.h" |
#include "ui/accessibility/ax_view_state.h" |
+#include "ui/aura/window.h" |
#include "ui/base/ui_base_switches_util.h" |
#include "ui/events/event.h" |
#include "ui/views/accessibility/native_view_accessibility.h" |
@@ -301,6 +302,11 @@ void WebView::AttachWebContents() { |
OnBoundsChanged(bounds()); |
if (holder_->native_view() == view_to_attach) |
return; |
+ |
+ // Fullscreen views are made visible by content. |
+ if (!is_embedding_fullscreen_widget_) |
sky
2014/09/15 20:40:39
Why is this code any different when there is a ful
ananta
2014/09/15 21:21:09
Updated the comment to clarify why we should not b
|
+ view_to_attach->Show(); |
+ |
holder_->Attach(view_to_attach); |
// The view will not be focused automatically when it is attached, so we need |
@@ -320,6 +326,10 @@ void WebView::AttachWebContents() { |
void WebView::DetachWebContents() { |
if (web_contents()) { |
+ // Fullscreen views are shown/hidden by content. |
+ if (!is_embedding_fullscreen_widget_) |
+ web_contents()->GetNativeView()->Hide(); |
+ |
holder_->Detach(); |
#if defined(OS_WIN) |
if (!is_embedding_fullscreen_widget_) |