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 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 // static | 35 // static |
36 gfx::Display ScreenAsh::FindDisplayContainingPoint(const gfx::Point& point) { | 36 gfx::Display ScreenAsh::FindDisplayContainingPoint(const gfx::Point& point) { |
37 return GetDisplayManager()->FindDisplayContainingPoint(point); | 37 return GetDisplayManager()->FindDisplayContainingPoint(point); |
38 } | 38 } |
39 | 39 |
40 // static | 40 // static |
41 gfx::Rect ScreenAsh::GetMaximizedWindowBoundsInParent(aura::Window* window) { | 41 gfx::Rect ScreenAsh::GetMaximizedWindowBoundsInParent(aura::Window* window) { |
42 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) | 42 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) |
43 return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); | 43 return GetDisplayWorkAreaBoundsInParent(window); |
44 else | 44 else |
45 return GetDisplayBoundsInParent(window); | 45 return GetDisplayBoundsInParent(window); |
46 } | 46 } |
47 | 47 |
48 // static | 48 // static |
49 gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBoundsInParent( | |
50 aura::Window* window) { | |
51 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) | |
52 return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); | |
53 else | |
54 return GetDisplayWorkAreaBoundsInParent(window); | |
55 } | |
56 | |
57 // static | |
58 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { | 49 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { |
59 return ConvertRectFromScreen( | 50 return ConvertRectFromScreen( |
60 window->parent(), | 51 window->parent(), |
61 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); | 52 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); |
62 } | 53 } |
63 | 54 |
64 // static | 55 // static |
65 gfx::Rect ScreenAsh::GetDisplayWorkAreaBoundsInParent(aura::Window* window) { | 56 gfx::Rect ScreenAsh::GetDisplayWorkAreaBoundsInParent(aura::Window* window) { |
66 return ConvertRectFromScreen( | 57 return ConvertRectFromScreen( |
67 window->parent(), | 58 window->parent(), |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 109 |
119 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { | 110 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { |
120 return GetDisplayManager()->GetDisplayMatching(match_rect); | 111 return GetDisplayManager()->GetDisplayMatching(match_rect); |
121 } | 112 } |
122 | 113 |
123 gfx::Display ScreenAsh::GetPrimaryDisplay() const { | 114 gfx::Display ScreenAsh::GetPrimaryDisplay() const { |
124 return DisplayController::GetPrimaryDisplay(); | 115 return DisplayController::GetPrimaryDisplay(); |
125 } | 116 } |
126 | 117 |
127 } // namespace ash | 118 } // namespace ash |
OLD | NEW |