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

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: I think the content_unittests timeout on linux_aura is flake, but try to fix it anyway. 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..89e23c05e642ab814530fbe39ad6bcd70d6c61f8 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,20 @@ void RenderWidgetHostViewAura::InitAsPopup(
window_->Init(ui::LAYER_TEXTURED);
window_->SetName("RenderWidgetHostViewAura");
- aura::Window* parent = NULL;
aura::RootWindow* root = popup_parent_host_view_->window_->GetRootWindow();
+
+ // TODO(erg): While I could make sure details of the StackingClient are
sky 2012/11/21 23:35:59 Oshima is changing this at https://codereview.chro
+ // hidden behind aura, hiding the details of the ScreenPositionClient will
+ // take another effort.
+ gfx::Point origin_in_screen(bounds_in_display.origin());
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
- if (screen_position_client) {
- gfx::Point origin_in_screen(bounds_in_display.origin());
+ if (screen_position_client)
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,
+ gfx::Rect(origin_in_screen, bounds_in_display.size()));
SetBounds(bounds_in_display);
Show();
}
@@ -345,7 +347,9 @@ void RenderWidgetHostViewAura::InitAsFullscreen(
window_->Init(ui::LAYER_TEXTURED);
window_->SetName("RenderWidgetHostViewAura");
window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
- aura::Window* parent = NULL;
+
+ aura::RootWindow* parent = NULL;
+ gfx::Rect bounds;
if (reference_host_view) {
aura::Window* reference_window =
static_cast<RenderWidgetHostViewAura*>(reference_host_view)->window_;
@@ -355,13 +359,11 @@ void RenderWidgetHostViewAura::InitAsFullscreen(
}
gfx::Display display = gfx::Screen::GetScreenFor(window_)->
GetDisplayNearestWindow(reference_window);
- aura::client::StackingClient* stacking_client =
- aura::client::GetStackingClient();
- if (stacking_client)
- parent = stacking_client->GetDefaultParent(
- window_, window_, display.bounds());
+ parent = reference_window->GetRootWindow();
+ bounds = display.bounds();
}
- window_->SetParent(parent);
+ window_->SetDefaultParentByTargetRoot(parent, bounds);
+
Show();
Focus();
}

Powered by Google App Engine
This is Rietveld 408576698