Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: ui/views/controls/webview/webview.cc

Issue 569153005: Relanding this with fixes for the unit test failures which required addition of some more plumbing … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More leak fixes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/webview/DEPS ('k') | ui/views/controls/webview/webview.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e7885005272b60c12fd514ee434102bb64d7c9ba 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,12 @@ void WebView::AttachWebContents() {
OnBoundsChanged(bounds());
if (holder_->native_view() == view_to_attach)
return;
+
+ // Fullscreen widgets are not parented by a WebContentsView. Their visibility
+ // is controlled by content i.e. (RenderWidgetHost)
+ if (!is_embedding_fullscreen_widget_)
+ 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 +327,11 @@ void WebView::AttachWebContents() {
void WebView::DetachWebContents() {
if (web_contents()) {
+ // Fullscreen widgets are not parented by a WebContentsView. Their
+ // visibility is controlled by content i.e. (RenderWidgetHost).
+ if (!is_embedding_fullscreen_widget_)
+ web_contents()->GetNativeView()->Hide();
+
holder_->Detach();
#if defined(OS_WIN)
if (!is_embedding_fullscreen_widget_)
« no previous file with comments | « ui/views/controls/webview/DEPS ('k') | ui/views/controls/webview/webview.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698