OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/display/screen_ash.h" | 5 #include "ash/display/screen_ash.h" |
6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" |
7 #include "ash/common/wm/root_window_finder.h" | 8 #include "ash/common/wm/root_window_finder.h" |
8 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
9 #include "ash/display/window_tree_host_manager.h" | 10 #include "ash/display/window_tree_host_manager.h" |
10 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
11 #include "ash/root_window_settings.h" | 12 #include "ash/root_window_settings.h" |
12 #include "ash/shelf/shelf_layout_manager.h" | 13 #include "ash/shelf/shelf_layout_manager.h" |
13 #include "ash/shelf/shelf_widget.h" | 14 #include "ash/shelf/shelf_widget.h" |
14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
15 #include "ash/wm/aura/wm_window_aura.h" | |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "ui/aura/client/screen_position_client.h" | 17 #include "ui/aura/client/screen_position_client.h" |
18 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
19 #include "ui/aura/window_event_dispatcher.h" | 19 #include "ui/aura/window_event_dispatcher.h" |
20 #include "ui/display/display.h" | 20 #include "ui/display/display.h" |
21 #include "ui/display/display_finder.h" | 21 #include "ui/display/display_finder.h" |
22 #include "ui/display/screen.h" | 22 #include "ui/display/screen.h" |
23 | 23 |
24 namespace ash { | 24 namespace ash { |
25 | 25 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return aura::Env::GetInstance()->last_mouse_location(); | 104 return aura::Env::GetInstance()->last_mouse_location(); |
105 } | 105 } |
106 | 106 |
107 bool ScreenAsh::IsWindowUnderCursor(gfx::NativeWindow window) { | 107 bool ScreenAsh::IsWindowUnderCursor(gfx::NativeWindow window) { |
108 return GetWindowAtScreenPoint( | 108 return GetWindowAtScreenPoint( |
109 display::Screen::GetScreen()->GetCursorScreenPoint()) == window; | 109 display::Screen::GetScreen()->GetCursorScreenPoint()) == window; |
110 } | 110 } |
111 | 111 |
112 gfx::NativeWindow ScreenAsh::GetWindowAtScreenPoint(const gfx::Point& point) { | 112 gfx::NativeWindow ScreenAsh::GetWindowAtScreenPoint(const gfx::Point& point) { |
113 aura::Window* root_window = | 113 aura::Window* root_window = |
114 wm::WmWindowAura::GetAuraWindow(wm::GetRootWindowAt(point)); | 114 WmWindowAura::GetAuraWindow(wm::GetRootWindowAt(point)); |
115 aura::client::ScreenPositionClient* position_client = | 115 aura::client::ScreenPositionClient* position_client = |
116 aura::client::GetScreenPositionClient(root_window); | 116 aura::client::GetScreenPositionClient(root_window); |
117 | 117 |
118 gfx::Point local_point = point; | 118 gfx::Point local_point = point; |
119 if (position_client) | 119 if (position_client) |
120 position_client->ConvertPointFromScreen(root_window, &local_point); | 120 position_client->ConvertPointFromScreen(root_window, &local_point); |
121 | 121 |
122 return root_window->GetTopWindowContainingPoint(local_point); | 122 return root_window->GetTopWindowContainingPoint(local_point); |
123 } | 123 } |
124 | 124 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 void ScreenAsh::RemoveObserver(display::DisplayObserver* observer) { | 190 void ScreenAsh::RemoveObserver(display::DisplayObserver* observer) { |
191 observers_.RemoveObserver(observer); | 191 observers_.RemoveObserver(observer); |
192 } | 192 } |
193 | 193 |
194 display::Screen* ScreenAsh::CloneForShutdown() { | 194 display::Screen* ScreenAsh::CloneForShutdown() { |
195 return new ScreenForShutdown(this); | 195 return new ScreenForShutdown(this); |
196 } | 196 } |
197 | 197 |
198 } // namespace ash | 198 } // namespace ash |
OLD | NEW |