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" |
| 8 #include "ash/wm/shelf_layout_manager.h" |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
9 #include "ui/aura/monitor.h" | 11 #include "ui/aura/monitor.h" |
10 #include "ui/aura/monitor_manager.h" | 12 #include "ui/aura/monitor_manager.h" |
11 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
12 | 14 |
13 namespace ash { | 15 namespace ash { |
14 | 16 |
15 // TODO(oshima): For m19, the origin of work area/monitor bounds for | 17 // 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 | 18 // views/aura is (0,0) because it's simple and enough. Fix this when |
17 // real multi monitor support is implemented. | 19 // real multi monitor support is implemented. |
18 | 20 |
19 namespace { | 21 namespace { |
20 aura::MonitorManager* GetMonitorManager() { | 22 aura::MonitorManager* GetMonitorManager() { |
21 return aura::Env::GetInstance()->monitor_manager(); | 23 return aura::Env::GetInstance()->monitor_manager(); |
22 } | 24 } |
23 } // namespace | 25 } // namespace |
24 | 26 |
25 ScreenAsh::ScreenAsh(aura::RootWindow* root_window) | 27 ScreenAsh::ScreenAsh(aura::RootWindow* root_window) |
26 : root_window_(root_window) { | 28 : root_window_(root_window) { |
27 } | 29 } |
28 | 30 |
29 ScreenAsh::~ScreenAsh() { | 31 ScreenAsh::~ScreenAsh() { |
30 } | 32 } |
31 | 33 |
| 34 // static |
| 35 gfx::Rect ScreenAsh::GetMaximizedWindowBounds(aura::Window* window) { |
| 36 return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); |
| 37 } |
| 38 |
| 39 // static |
| 40 gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBounds(aura::Window* window) { |
| 41 return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); |
| 42 } |
| 43 |
32 gfx::Point ScreenAsh::GetCursorScreenPointImpl() { | 44 gfx::Point ScreenAsh::GetCursorScreenPointImpl() { |
33 return root_window_->last_mouse_location(); | 45 return root_window_->last_mouse_location(); |
34 } | 46 } |
35 | 47 |
36 gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestWindowImpl( | 48 gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestWindowImpl( |
37 gfx::NativeWindow window) { | 49 gfx::NativeWindow window) { |
38 return GetMonitorManager()->GetMonitorNearestWindow(window)-> | 50 return GetMonitorManager()->GetMonitorNearestWindow(window)-> |
39 GetWorkAreaBounds(); | 51 GetWorkAreaBounds(); |
40 } | 52 } |
41 | 53 |
(...skipping 22 matching lines...) Expand all Loading... |
64 | 76 |
65 gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() { | 77 gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() { |
66 return GetMonitorManager()->GetMonitorAt(0)->size(); | 78 return GetMonitorManager()->GetMonitorAt(0)->size(); |
67 } | 79 } |
68 | 80 |
69 int ScreenAsh::GetNumMonitorsImpl() { | 81 int ScreenAsh::GetNumMonitorsImpl() { |
70 return GetMonitorManager()->GetNumMonitors(); | 82 return GetMonitorManager()->GetNumMonitors(); |
71 } | 83 } |
72 | 84 |
73 } // namespace ash | 85 } // namespace ash |
OLD | NEW |