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); |
} |