Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Side by Side Diff: ash/screen_util.cc

Issue 2355063002: Separate ash::test::DisplayManagerTestApi from ash (Closed)
Patch Set: review comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/screen_util.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/screen_util.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698