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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_position_client.cc

Issue 184903003: Window ownership -> WindowTreeHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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: ui/views/widget/desktop_aura/desktop_screen_position_client.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
index 23018c57ba7691ce3406dc2c73a231473ff4dbe1..b5187f5432e9e8ecb6f317872329a9cac9d3d9dc 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
@@ -16,7 +16,7 @@ namespace {
gfx::Point GetOrigin(const aura::Window* root_window) {
gfx::Point origin_in_pixels =
- root_window->GetDispatcher()->host()->GetBounds().origin();
+ root_window->GetHost()->GetBounds().origin();
aura::Window* window = const_cast<aura::Window*>(root_window);
float scale = gfx::Screen::GetScreenFor(window)->
GetDisplayNearestWindow(window).device_scale_factor();
@@ -37,10 +37,13 @@ bool PositionWindowInScreenCoordinates(aura::Window* window) {
} // namespace
-DesktopScreenPositionClient::DesktopScreenPositionClient() {
+DesktopScreenPositionClient::DesktopScreenPositionClient(
+ aura::Window* root_window) : root_window_(root_window) {
+ aura::client::SetScreenPositionClient(root_window_, this);
}
DesktopScreenPositionClient::~DesktopScreenPositionClient() {
+ aura::client::SetScreenPositionClient(root_window_, NULL);
}
void DesktopScreenPositionClient::ConvertPointToScreen(
@@ -92,7 +95,7 @@ void DesktopScreenPositionClient::SetBounds(
desktop_native_widget->GetNativeView() == window) {
// |window| is the content_window.
// Setting bounds of root resizes |window|.
- root->GetDispatcher()->host()->SetBounds(bounds);
+ root->GetHost()->SetBounds(bounds);
} else {
window->SetBounds(bounds);
}
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_screen_position_client.h ('k') | ui/views/widget/desktop_aura/desktop_screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698