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

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: Fix SimpleMessageBoxViews asan failure. 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
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 a6c8cf4087953ee199256c17e2f581ca0d1b5e4b..4b9e9ce16e27426b9be3a1befe7b7d571c583366 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -634,10 +634,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");

Powered by Google App Engine
This is Rietveld 408576698