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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 11421006: Desktop aura: Break aura::Window::SetParent in two. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add parent finding thing to web_contents_view_aura.cc. I guess it was necessary after all? Created 8 years, 1 month 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/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index b4a1bc62abaf62b7195a822e272d31a2f9467576..4f1b93f32eb116e4f941d74ca93f2327b91d8b85 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -322,18 +322,9 @@ void RenderWidgetHostViewAura::InitAsPopup(
window_->Init(ui::LAYER_TEXTURED);
window_->SetName("RenderWidgetHostViewAura");
- aura::Window* parent = NULL;
aura::RootWindow* root = popup_parent_host_view_->window_->GetRootWindow();
- aura::client::ScreenPositionClient* screen_position_client =
- aura::client::GetScreenPositionClient(root);
- if (screen_position_client) {
- gfx::Point origin_in_screen(bounds_in_display.origin());
- screen_position_client->ConvertPointToScreen(root, &origin_in_screen);
- parent = aura::client::GetStackingClient()->GetDefaultParent(
- window_, window_,
- gfx::Rect(origin_in_screen, bounds_in_display.size()));
- }
- window_->SetParent(parent);
+ window_->SetDefaultParentByTargetRoot(root);
+
SetBounds(bounds_in_display);
Show();
}
@@ -345,6 +336,8 @@ void RenderWidgetHostViewAura::InitAsFullscreen(
window_->Init(ui::LAYER_TEXTURED);
window_->SetName("RenderWidgetHostViewAura");
window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
+
+ // ---------------------- FIX ME --------------------------
aura::Window* parent = NULL;
if (reference_host_view) {
aura::Window* reference_window =
@@ -356,12 +349,14 @@ void RenderWidgetHostViewAura::InitAsFullscreen(
gfx::Display display = gfx::Screen::GetScreenFor(window_)->
GetDisplayNearestWindow(reference_window);
aura::client::StackingClient* stacking_client =
- aura::client::GetStackingClient();
+ aura::client::GetStackingClient(reference_window);
if (stacking_client)
parent = stacking_client->GetDefaultParent(
window_, window_, display.bounds());
}
- window_->SetParent(parent);
+ window_->SetParentTo(parent);
+ // ---------------------- /FIX ME --------------------------
+
Show();
Focus();
}

Powered by Google App Engine
This is Rietveld 408576698