| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_util.h" | 5 #include "ash/screen_util.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_shelf_aura.h" | 7 #include "ash/aura/wm_shelf_aura.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/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // static | 65 // static |
| 66 gfx::Rect ScreenUtil::ConvertRectFromScreen(aura::Window* window, | 66 gfx::Rect ScreenUtil::ConvertRectFromScreen(aura::Window* window, |
| 67 const gfx::Rect& rect) { | 67 const gfx::Rect& rect) { |
| 68 gfx::Point point = rect.origin(); | 68 gfx::Point point = rect.origin(); |
| 69 aura::client::GetScreenPositionClient(window->GetRootWindow()) | 69 aura::client::GetScreenPositionClient(window->GetRootWindow()) |
| 70 ->ConvertPointFromScreen(window, &point); | 70 ->ConvertPointFromScreen(window, &point); |
| 71 return gfx::Rect(point, rect.size()); | 71 return gfx::Rect(point, rect.size()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // static | 74 // static |
| 75 const display::Display& ScreenUtil::GetSecondaryDisplay() { | |
| 76 DisplayManager* display_manager = GetDisplayManager(); | |
| 77 CHECK_LE(2U, display_manager->GetNumDisplays()); | |
| 78 return display_manager->GetDisplayAt(0).id() == | |
| 79 display::Screen::GetScreen()->GetPrimaryDisplay().id() | |
| 80 ? display_manager->GetDisplayAt(1) | |
| 81 : display_manager->GetDisplayAt(0); | |
| 82 } | |
| 83 | 75 |
| 84 } // namespace ash | 76 } // namespace ash |
| OLD | NEW |