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/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" |
| 11 #include "ash/shelf/shelf_widget.h" |
10 #include "ash/shell.h" | 12 #include "ash/shell.h" |
11 #include "ash/wm/property_util.h" | 13 #include "ash/wm/property_util.h" |
12 #include "ash/wm/coordinate_conversion.h" | 14 #include "ash/wm/coordinate_conversion.h" |
13 #include "ash/wm/shelf_layout_manager.h" | |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "ui/aura/client/screen_position_client.h" | 16 #include "ui/aura/client/screen_position_client.h" |
16 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
17 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
18 #include "ui/gfx/display.h" | 19 #include "ui/gfx/display.h" |
19 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
20 | 21 |
21 namespace ash { | 22 namespace ash { |
22 | 23 |
23 namespace { | 24 namespace { |
24 internal::DisplayManager* GetDisplayManager() { | 25 internal::DisplayManager* GetDisplayManager() { |
25 return Shell::GetInstance()->display_manager(); | 26 return Shell::GetInstance()->display_manager(); |
26 } | 27 } |
27 } // namespace | 28 } // namespace |
28 | 29 |
29 ScreenAsh::ScreenAsh() { | 30 ScreenAsh::ScreenAsh() { |
30 } | 31 } |
31 | 32 |
32 ScreenAsh::~ScreenAsh() { | 33 ScreenAsh::~ScreenAsh() { |
33 } | 34 } |
34 | 35 |
35 // static | 36 // static |
36 gfx::Display ScreenAsh::FindDisplayContainingPoint(const gfx::Point& point) { | 37 gfx::Display ScreenAsh::FindDisplayContainingPoint(const gfx::Point& point) { |
37 return GetDisplayManager()->FindDisplayContainingPoint(point); | 38 return GetDisplayManager()->FindDisplayContainingPoint(point); |
38 } | 39 } |
39 | 40 |
40 // static | 41 // static |
41 gfx::Rect ScreenAsh::GetMaximizedWindowBoundsInParent(aura::Window* window) { | 42 gfx::Rect ScreenAsh::GetMaximizedWindowBoundsInParent(aura::Window* window) { |
42 if (GetRootWindowController(window->GetRootWindow())->launcher()) | 43 if (GetRootWindowController(window->GetRootWindow())->shelf()->launcher()) |
43 return GetDisplayWorkAreaBoundsInParent(window); | 44 return GetDisplayWorkAreaBoundsInParent(window); |
44 else | 45 else |
45 return GetDisplayBoundsInParent(window); | 46 return GetDisplayBoundsInParent(window); |
46 } | 47 } |
47 | 48 |
48 // static | 49 // static |
49 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { | 50 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { |
50 return ConvertRectFromScreen( | 51 return ConvertRectFromScreen( |
51 window->parent(), | 52 window->parent(), |
52 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); | 53 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 137 |
137 void ScreenAsh::AddObserver(gfx::DisplayObserver* observer) { | 138 void ScreenAsh::AddObserver(gfx::DisplayObserver* observer) { |
138 observers_.AddObserver(observer); | 139 observers_.AddObserver(observer); |
139 } | 140 } |
140 | 141 |
141 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { | 142 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { |
142 observers_.RemoveObserver(observer); | 143 observers_.RemoveObserver(observer); |
143 } | 144 } |
144 | 145 |
145 } // namespace ash | 146 } // namespace ash |
OLD | NEW |