OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" | 5 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" |
6 | 6 |
7 #include "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
8 #include "ui/gfx/display.h" | 8 #include "ui/gfx/display.h" |
9 #include "ui/gfx/point_conversions.h" | 9 #include "ui/gfx/point_conversions.h" |
10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 void DesktopScreenPositionClient::ConvertPointFromScreen( | 53 void DesktopScreenPositionClient::ConvertPointFromScreen( |
54 const aura::Window* window, gfx::Point* point) { | 54 const aura::Window* window, gfx::Point* point) { |
55 const aura::RootWindow* root_window = window->GetRootWindow(); | 55 const aura::RootWindow* root_window = window->GetRootWindow(); |
56 gfx::Point origin = GetOrigin(root_window); | 56 gfx::Point origin = GetOrigin(root_window); |
57 point->Offset(-origin.x(), -origin.y()); | 57 point->Offset(-origin.x(), -origin.y()); |
58 aura::Window::ConvertPointToTarget(root_window, window, point); | 58 aura::Window::ConvertPointToTarget(root_window, window, point); |
59 } | 59 } |
60 | 60 |
61 void DesktopScreenPositionClient::ConvertHostPointToScreen( | 61 void DesktopScreenPositionClient::ConvertHostPointToScreen( |
62 aura::RootWindow* window, gfx::Point* point) { | 62 aura::Window* window, gfx::Point* point) { |
63 ConvertPointToScreen(window, point); | 63 aura::RootWindow* root_window = window->GetRootWindow(); |
| 64 ConvertPointToScreen(root_window, point); |
64 } | 65 } |
65 | 66 |
66 void DesktopScreenPositionClient::SetBounds( | 67 void DesktopScreenPositionClient::SetBounds( |
67 aura::Window* window, | 68 aura::Window* window, |
68 const gfx::Rect& bounds, | 69 const gfx::Rect& bounds, |
69 const gfx::Display& display) { | 70 const gfx::Display& display) { |
70 // TODO: Use the 3rd parameter, |display|. | 71 // TODO: Use the 3rd parameter, |display|. |
71 aura::RootWindow* root = window->GetRootWindow(); | 72 aura::RootWindow* root = window->GetRootWindow(); |
72 | 73 |
73 if (PositionWindowInScreenCoordinates(window)) { | 74 if (PositionWindowInScreenCoordinates(window)) { |
(...skipping 14 matching lines...) Expand all Loading... |
88 DesktopNativeWidgetAura::ForWindow(window); | 89 DesktopNativeWidgetAura::ForWindow(window); |
89 if (desktop_native_widget) { | 90 if (desktop_native_widget) { |
90 root->SetHostBounds(bounds); | 91 root->SetHostBounds(bounds); |
91 // Setting bounds of root resizes |window|. | 92 // Setting bounds of root resizes |window|. |
92 } else { | 93 } else { |
93 window->SetBounds(bounds); | 94 window->SetBounds(bounds); |
94 } | 95 } |
95 } | 96 } |
96 | 97 |
97 } // namespace views | 98 } // namespace views |
OLD | NEW |