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

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: Fix ash_unittests 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 1a902a47448afe8c15a97dd05a9f1c3fb9f9057b..25b37f005b25cb102eab04dd29d2256f829ae508 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -324,15 +324,18 @@ void RenderWidgetHostViewAura::InitAsPopup(
window_->SetName("RenderWidgetHostViewAura");
aura::RootWindow* root = popup_parent_host_view_->window_->GetRootWindow();
- aura::Window* parent = aura::client::GetStackingClient()->GetDefaultParent(
- window_, window_, bounds_in_screen);
- window_->SetParent(parent);
+ window_->SetDefaultParentByRootWindow(root, bounds_in_screen);
+ // TODO(erg): While I could make sure details of the StackingClient are
+ // hidden behind aura, hiding the details of the ScreenPositionClient will
+ // take another effort.
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root);
gfx::Point origin_in_parent(bounds_in_screen.origin());
- if (screen_position_client)
- screen_position_client->ConvertPointFromScreen(parent, &origin_in_parent);
+ if (screen_position_client) {
+ screen_position_client->ConvertPointFromScreen(
+ window_->parent(), &origin_in_parent);
+ }
SetBounds(gfx::Rect(origin_in_parent, bounds_in_screen.size()));
Show();
}
@@ -344,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_;
@@ -354,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_->SetDefaultParentByRootWindow(parent, bounds);
+
Show();
Focus();
}

Powered by Google App Engine
This is Rietveld 408576698