| 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 "ash/screen_ash.h" | 5 #include "ash/screen_ash.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/coordinate_conversion.h" |
| 8 #include "ash/wm/shelf_layout_manager.h" | 9 #include "ash/wm/shelf_layout_manager.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "ui/aura/client/screen_position_client.h" | 11 #include "ui/aura/client/screen_position_client.h" |
| 11 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 12 #include "ui/aura/display_manager.h" | 13 #include "ui/aura/display_manager.h" |
| 13 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
| 14 #include "ui/gfx/display.h" | 15 #include "ui/gfx/display.h" |
| 15 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 16 | 17 |
| 17 namespace ash { | 18 namespace ash { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 ConvertPointFromScreen(window, &point); | 77 ConvertPointFromScreen(window, &point); |
| 77 return gfx::Rect(point, rect.size()); | 78 return gfx::Rect(point, rect.size()); |
| 78 } | 79 } |
| 79 | 80 |
| 80 gfx::Point ScreenAsh::GetCursorScreenPoint() { | 81 gfx::Point ScreenAsh::GetCursorScreenPoint() { |
| 81 return aura::Env::GetInstance()->last_mouse_location(); | 82 return aura::Env::GetInstance()->last_mouse_location(); |
| 82 } | 83 } |
| 83 | 84 |
| 84 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { | 85 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { |
| 85 const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); | 86 const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); |
| 86 return Shell::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); | 87 return wm::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); |
| 87 } | 88 } |
| 88 | 89 |
| 89 int ScreenAsh::GetNumDisplays() { | 90 int ScreenAsh::GetNumDisplays() { |
| 90 return GetDisplayManager()->GetNumDisplays(); | 91 return GetDisplayManager()->GetNumDisplays(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { | 94 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { |
| 94 return GetDisplayManager()->GetDisplayNearestWindow(window); | 95 return GetDisplayManager()->GetDisplayNearestWindow(window); |
| 95 } | 96 } |
| 96 | 97 |
| 97 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { | 98 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { |
| 98 return GetDisplayManager()->GetDisplayNearestPoint(point); | 99 return GetDisplayManager()->GetDisplayNearestPoint(point); |
| 99 } | 100 } |
| 100 | 101 |
| 101 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { | 102 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { |
| 102 return GetDisplayManager()->GetDisplayMatching(match_rect); | 103 return GetDisplayManager()->GetDisplayMatching(match_rect); |
| 103 } | 104 } |
| 104 | 105 |
| 105 gfx::Display ScreenAsh::GetPrimaryDisplay() const { | 106 gfx::Display ScreenAsh::GetPrimaryDisplay() const { |
| 106 return *GetDisplayManager()->GetDisplayAt(0); | 107 return *GetDisplayManager()->GetDisplayAt(0); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace ash | 110 } // namespace ash |
| OLD | NEW |