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/root_window_controller.h" | |
9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/wm/property_util.h" | |
10 #include "ash/wm/coordinate_conversion.h" | 12 #include "ash/wm/coordinate_conversion.h" |
11 #include "ash/wm/shelf_layout_manager.h" | 13 #include "ash/wm/shelf_layout_manager.h" |
12 #include "base/logging.h" | 14 #include "base/logging.h" |
13 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
14 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
15 #include "ui/aura/display_manager.h" | 17 #include "ui/aura/display_manager.h" |
16 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
17 #include "ui/gfx/display.h" | 19 #include "ui/gfx/display.h" |
18 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
19 | 21 |
(...skipping 12 matching lines...) Expand all Loading... | |
32 ScreenAsh::~ScreenAsh() { | 34 ScreenAsh::~ScreenAsh() { |
33 } | 35 } |
34 | 36 |
35 // static | 37 // static |
36 gfx::Display ScreenAsh::FindDisplayContainingPoint(const gfx::Point& point) { | 38 gfx::Display ScreenAsh::FindDisplayContainingPoint(const gfx::Point& point) { |
37 return GetDisplayManager()->FindDisplayContainingPoint(point); | 39 return GetDisplayManager()->FindDisplayContainingPoint(point); |
38 } | 40 } |
39 | 41 |
40 // static | 42 // static |
41 gfx::Rect ScreenAsh::GetMaximizedWindowBoundsInParent(aura::Window* window) { | 43 gfx::Rect ScreenAsh::GetMaximizedWindowBoundsInParent(aura::Window* window) { |
42 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) | 44 if (GetRootWindowController(window->GetRootWindow())->launcher()) |
43 return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); | 45 return GetDisplayWorkAreaBoundsInParent(window); |
44 else | 46 else |
45 return GetDisplayBoundsInParent(window); | 47 return GetDisplayBoundsInParent(window); |
46 } | 48 } |
47 | 49 |
48 // static | 50 // static |
49 gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBoundsInParent( | 51 gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBoundsInParent( |
50 aura::Window* window) { | 52 aura::Window* window) { |
51 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) | 53 return GetDisplayWorkAreaBoundsInParent(window); |
52 return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); | |
53 else | |
54 return GetDisplayWorkAreaBoundsInParent(window); | |
55 } | 54 } |
oshima
2012/10/17 15:26:41
These two methods will be gone after
http://codere
| |
56 | 55 |
57 // static | 56 // static |
58 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { | 57 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { |
59 return ConvertRectFromScreen( | 58 return ConvertRectFromScreen( |
60 window->parent(), | 59 window->parent(), |
61 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); | 60 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); |
62 } | 61 } |
63 | 62 |
64 // static | 63 // static |
65 gfx::Rect ScreenAsh::GetDisplayWorkAreaBoundsInParent(aura::Window* window) { | 64 gfx::Rect ScreenAsh::GetDisplayWorkAreaBoundsInParent(aura::Window* window) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 | 117 |
119 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { | 118 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { |
120 return GetDisplayManager()->GetDisplayMatching(match_rect); | 119 return GetDisplayManager()->GetDisplayMatching(match_rect); |
121 } | 120 } |
122 | 121 |
123 gfx::Display ScreenAsh::GetPrimaryDisplay() const { | 122 gfx::Display ScreenAsh::GetPrimaryDisplay() const { |
124 return DisplayController::GetPrimaryDisplay(); | 123 return DisplayController::GetPrimaryDisplay(); |
125 } | 124 } |
126 | 125 |
127 } // namespace ash | 126 } // namespace ash |
OLD | NEW |