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/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/multi_display_manager.h" | 8 #include "ash/display/multi_display_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // static | 89 // static |
90 const gfx::Display& ScreenAsh::GetSecondaryDisplay() { | 90 const gfx::Display& ScreenAsh::GetSecondaryDisplay() { |
91 return *(Shell::GetInstance()->display_controller()->GetSecondaryDisplay()); | 91 return *(Shell::GetInstance()->display_controller()->GetSecondaryDisplay()); |
92 } | 92 } |
93 | 93 |
94 gfx::Point ScreenAsh::GetCursorScreenPoint() { | 94 gfx::Point ScreenAsh::GetCursorScreenPoint() { |
95 return aura::Env::GetInstance()->last_mouse_location(); | 95 return aura::Env::GetInstance()->last_mouse_location(); |
96 } | 96 } |
97 | 97 |
98 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { | 98 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { |
99 const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); | 99 const gfx::Point point = gfx::Screen::GetCursorScreenPoint( |
| 100 ash::Shell::GetRootNativeView()); |
100 return wm::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); | 101 return wm::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); |
101 } | 102 } |
102 | 103 |
103 int ScreenAsh::GetNumDisplays() { | 104 int ScreenAsh::GetNumDisplays() { |
104 return GetDisplayManager()->GetNumDisplays(); | 105 return GetDisplayManager()->GetNumDisplays(); |
105 } | 106 } |
106 | 107 |
107 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { | 108 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { |
108 return GetDisplayManager()->GetDisplayNearestWindow(window); | 109 return GetDisplayManager()->GetDisplayNearestWindow(window); |
109 } | 110 } |
110 | 111 |
111 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { | 112 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { |
112 return GetDisplayManager()->GetDisplayNearestPoint(point); | 113 return GetDisplayManager()->GetDisplayNearestPoint(point); |
113 } | 114 } |
114 | 115 |
115 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { | 116 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { |
116 return GetDisplayManager()->GetDisplayMatching(match_rect); | 117 return GetDisplayManager()->GetDisplayMatching(match_rect); |
117 } | 118 } |
118 | 119 |
119 gfx::Display ScreenAsh::GetPrimaryDisplay() const { | 120 gfx::Display ScreenAsh::GetPrimaryDisplay() const { |
120 return DisplayController::GetPrimaryDisplay(); | 121 return DisplayController::GetPrimaryDisplay(); |
121 } | 122 } |
122 | 123 |
123 } // namespace ash | 124 } // namespace ash |
OLD | NEW |