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

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 11829040: Fix the content_browsertests everywhere maybe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 7 years, 11 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/content_shell.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index b7c98b19b0e23e810f42615976bad1341d3f60e9..cee09c3d8a5a3caa4dd4e8932ee78170655e036c 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -741,10 +741,18 @@ void WebContentsViewAura::CreateView(
window_->SetType(aura::client::WINDOW_TYPE_CONTROL);
window_->SetTransparent(false);
window_->Init(ui::LAYER_NOT_DRAWN);
- // TODO(mukai, erg): Should use a non-NULL value later when the DCHECK is
- // turned on in SetDefaultParentByRootWindow().
- aura::RootWindow* target_root = context ? context->GetRootWindow() : NULL;
- window_->SetDefaultParentByRootWindow(target_root, gfx::Rect());
+ if (context) {
+ // There are places where there is no context currently because object
+ // hierarchies are built before they're attached to a Widget. (See
+ // views::WebView as an example; GetWidget() returns NULL at the point
+ // where we are created.)
+ //
+ // It should be OK to not set a default parent since such users will
+ // explicitly add this WebContentsViewAura to their tree after they create
+ // us.
+ window_->SetDefaultParentByRootWindow(context->GetRootWindow(),
+ gfx::Rect());
+ }
window_->layer()->SetMasksToBounds(true);
window_->SetName("WebContentsViewAura");
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/content_shell.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698