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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
9 #include "ui/aura/monitor.h" | 9 #include "ui/aura/monitor.h" |
10 #include "ui/aura/monitor_manager.h" | 10 #include "ui/aura/monitor_manager.h" |
11 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 // TODO(oshima): For m19, the origin of work area/monitor bounds for | 15 // TODO(oshima): For m19, the origin of work area/monitor bounds for |
16 // views/aura is (0,0) because it's simple and enough. Fix this when | 16 // views/aura is (0,0) because it's simple and enough. Fix this when |
17 // real multi monitor support is implemented. | 17 // real multi monitor support is implemented. |
18 | 18 |
19 namespace { | 19 namespace { |
20 const aura::MonitorManager* GetMonitorManager() { | 20 aura::MonitorManager* GetMonitorManager() { |
21 return aura::Env::GetInstance()->monitor_manager(); | 21 return aura::Env::GetInstance()->monitor_manager(); |
22 } | 22 } |
23 } // namespace | 23 } // namespace |
24 | 24 |
25 ScreenAsh::ScreenAsh(aura::RootWindow* root_window) | 25 ScreenAsh::ScreenAsh(aura::RootWindow* root_window) |
26 : root_window_(root_window) { | 26 : root_window_(root_window) { |
27 } | 27 } |
28 | 28 |
29 ScreenAsh::~ScreenAsh() { | 29 ScreenAsh::~ScreenAsh() { |
30 } | 30 } |
(...skipping 25 matching lines...) Expand all Loading... |
56 // See the comment at the top. | 56 // See the comment at the top. |
57 return gfx::Rect(GetMonitorManager()->GetMonitorNearestPoint(point)->size()); | 57 return gfx::Rect(GetMonitorManager()->GetMonitorNearestPoint(point)->size()); |
58 } | 58 } |
59 | 59 |
60 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPointImpl() { | 60 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPointImpl() { |
61 const gfx::Point point = GetCursorScreenPoint(); | 61 const gfx::Point point = GetCursorScreenPoint(); |
62 return root_window_->GetTopWindowContainingPoint(point); | 62 return root_window_->GetTopWindowContainingPoint(point); |
63 } | 63 } |
64 | 64 |
65 gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() { | 65 gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() { |
66 return GetMonitorManager()->GetPrimaryMonitor()->size(); | 66 return GetMonitorManager()->GetMonitorAt(0)->size(); |
67 } | 67 } |
68 | 68 |
69 int ScreenAsh::GetNumMonitorsImpl() { | 69 int ScreenAsh::GetNumMonitorsImpl() { |
70 return GetMonitorManager()->GetNumMonitors(); | 70 return GetMonitorManager()->GetNumMonitors(); |
71 } | 71 } |
72 | 72 |
73 } // namespace ash | 73 } // namespace ash |
OLD | NEW |