| 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" | |
| 8 #include "ash/common/shelf/shelf_widget.h" | 7 #include "ash/common/shelf/shelf_widget.h" |
| 9 #include "ash/common/wm/root_window_finder.h" | 8 #include "ash/common/wm/root_window_finder.h" |
| 9 #include "ash/common/wm_window.h" |
| 10 #include "ash/display/window_tree_host_manager.h" | 10 #include "ash/display/window_tree_host_manager.h" |
| 11 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 12 #include "ash/root_window_settings.h" | 12 #include "ash/root_window_settings.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
| 16 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
| 17 #include "ui/aura/window_event_dispatcher.h" | 17 #include "ui/aura/window_event_dispatcher.h" |
| 18 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
| 19 #include "ui/display/display_finder.h" | 19 #include "ui/display/display_finder.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return aura::Env::GetInstance()->last_mouse_location(); | 89 return aura::Env::GetInstance()->last_mouse_location(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool ScreenAsh::IsWindowUnderCursor(gfx::NativeWindow window) { | 92 bool ScreenAsh::IsWindowUnderCursor(gfx::NativeWindow window) { |
| 93 return GetWindowAtScreenPoint( | 93 return GetWindowAtScreenPoint( |
| 94 display::Screen::GetScreen()->GetCursorScreenPoint()) == window; | 94 display::Screen::GetScreen()->GetCursorScreenPoint()) == window; |
| 95 } | 95 } |
| 96 | 96 |
| 97 gfx::NativeWindow ScreenAsh::GetWindowAtScreenPoint(const gfx::Point& point) { | 97 gfx::NativeWindow ScreenAsh::GetWindowAtScreenPoint(const gfx::Point& point) { |
| 98 aura::Window* root_window = | 98 aura::Window* root_window = |
| 99 WmWindowAura::GetAuraWindow(wm::GetRootWindowAt(point)); | 99 WmWindow::GetAuraWindow(wm::GetRootWindowAt(point)); |
| 100 aura::client::ScreenPositionClient* position_client = | 100 aura::client::ScreenPositionClient* position_client = |
| 101 aura::client::GetScreenPositionClient(root_window); | 101 aura::client::GetScreenPositionClient(root_window); |
| 102 | 102 |
| 103 gfx::Point local_point = point; | 103 gfx::Point local_point = point; |
| 104 if (position_client) | 104 if (position_client) |
| 105 position_client->ConvertPointFromScreen(root_window, &local_point); | 105 position_client->ConvertPointFromScreen(root_window, &local_point); |
| 106 | 106 |
| 107 return root_window->GetTopWindowContainingPoint(local_point); | 107 return root_window->GetTopWindowContainingPoint(local_point); |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 | 190 |
| 191 // static | 191 // static |
| 192 void ScreenAsh::CreateScreenForShutdown() { | 192 void ScreenAsh::CreateScreenForShutdown() { |
| 193 delete screen_for_shutdown; | 193 delete screen_for_shutdown; |
| 194 screen_for_shutdown = new ScreenForShutdown(display::Screen::GetScreen()); | 194 screen_for_shutdown = new ScreenForShutdown(display::Screen::GetScreen()); |
| 195 display::Screen::SetScreenInstance(screen_for_shutdown); | 195 display::Screen::SetScreenInstance(screen_for_shutdown); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace ash | 198 } // namespace ash |
| OLD | NEW |