Chromium Code Reviews| 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 20 matching lines...) Expand all Loading... | |
| 31 | 31 |
| 32 ScreenAsh::~ScreenAsh() { | 32 ScreenAsh::~ScreenAsh() { |
| 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) { |
|
sky
2012/10/01 14:11:48
Can't you nuke this entirely and folks instead use
| |
| 42 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) | 42 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) |
| 43 return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); | 43 return Shell::GetInstance()->shelf()->GetWorkAreaBounds(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( | 49 gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBoundsInParent( |
| 50 aura::Window* window) { | 50 aura::Window* window) { |
| 51 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) | 51 if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) |
| 52 return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); | 52 return Shell::GetInstance()->shelf()->GetWorkAreaBounds(window); |
| 53 else | 53 else |
| 54 return GetDisplayWorkAreaBoundsInParent(window); | 54 return GetDisplayWorkAreaBoundsInParent(window); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // static | 57 // static |
| 58 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { | 58 gfx::Rect ScreenAsh::GetDisplayBoundsInParent(aura::Window* window) { |
| 59 return ConvertRectFromScreen( | 59 return ConvertRectFromScreen( |
| 60 window->parent(), | 60 window->parent(), |
| 61 gfx::Screen::GetDisplayNearestWindow(window).bounds()); | 61 gfx::Screen::GetDisplayNearestWindow(window).bounds()); |
| 62 } | 62 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 | 114 |
| 115 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { | 115 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { |
| 116 return GetDisplayManager()->GetDisplayMatching(match_rect); | 116 return GetDisplayManager()->GetDisplayMatching(match_rect); |
| 117 } | 117 } |
| 118 | 118 |
| 119 gfx::Display ScreenAsh::GetPrimaryDisplay() const { | 119 gfx::Display ScreenAsh::GetPrimaryDisplay() const { |
| 120 return DisplayController::GetPrimaryDisplay(); | 120 return DisplayController::GetPrimaryDisplay(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace ash | 123 } // namespace ash |
| OLD | NEW |