Index: ui/views/controls/webview/webview.cc |
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc |
index f1f12d015446d245c42fea9bac362d5627040814..7e31097059dd5156f9d2ad00328137c46d701324 100644 |
--- a/ui/views/controls/webview/webview.cc |
+++ b/ui/views/controls/webview/webview.cc |
@@ -303,13 +303,14 @@ void WebView::AttachWebContents() { |
if (holder_->native_view() == view_to_attach) |
return; |
+ // The WCV needs to be parented before making it visible. |
+ holder_->Attach(view_to_attach); |
+ |
// 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 |
// to pass on focus to it if the FocusManager thinks the view is focused. Note |
// that not every Widget has a focus manager. |