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

Side by Side Diff: ash/screen_util.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 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/root_window_controller_unittest.cc ('k') | ash/shelf/overflow_bubble_view.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/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_widget.h" 10 #include "ash/shelf/shelf_widget.h"
(...skipping 24 matching lines...) Expand all
35 if (GetRootWindowController(window->GetRootWindow())->shelf()) 35 if (GetRootWindowController(window->GetRootWindow())->shelf())
36 return GetDisplayWorkAreaBoundsInParent(window); 36 return GetDisplayWorkAreaBoundsInParent(window);
37 else 37 else
38 return GetDisplayBoundsInParent(window); 38 return GetDisplayBoundsInParent(window);
39 } 39 }
40 40
41 // static 41 // static
42 gfx::Rect ScreenUtil::GetDisplayBoundsInParent(aura::Window* window) { 42 gfx::Rect ScreenUtil::GetDisplayBoundsInParent(aura::Window* window) {
43 return ConvertRectFromScreen( 43 return ConvertRectFromScreen(
44 window->parent(), 44 window->parent(),
45 Shell::GetScreen()->GetDisplayNearestWindow(window).bounds()); 45 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).bounds());
46 } 46 }
47 47
48 // static 48 // static
49 gfx::Rect ScreenUtil::GetDisplayWorkAreaBoundsInParent(aura::Window* window) { 49 gfx::Rect ScreenUtil::GetDisplayWorkAreaBoundsInParent(aura::Window* window) {
50 return ConvertRectFromScreen( 50 return ConvertRectFromScreen(
51 window->parent(), 51 window->parent(),
52 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area()); 52 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area());
53 } 53 }
54 54
55 gfx::Rect ScreenUtil::GetShelfDisplayBoundsInRoot(aura::Window* window) { 55 gfx::Rect ScreenUtil::GetShelfDisplayBoundsInRoot(aura::Window* window) {
56 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 56 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
57 if (display_manager->IsInUnifiedMode()) { 57 if (display_manager->IsInUnifiedMode()) {
58 // In unified desktop mode, there is only one shelf in the 1st display. 58 // In unified desktop mode, there is only one shelf in the 1st display.
59 const gfx::Display& first = 59 const gfx::Display& first =
60 display_manager->software_mirroring_display_list()[0]; 60 display_manager->software_mirroring_display_list()[0];
61 float scale = 61 float scale =
62 static_cast<float>(window->GetRootWindow()->bounds().height()) / 62 static_cast<float>(window->GetRootWindow()->bounds().height()) /
(...skipping 22 matching lines...) Expand all
85 aura::client::GetScreenPositionClient(window->GetRootWindow())-> 85 aura::client::GetScreenPositionClient(window->GetRootWindow())->
86 ConvertPointFromScreen(window, &point); 86 ConvertPointFromScreen(window, &point);
87 return gfx::Rect(point, rect.size()); 87 return gfx::Rect(point, rect.size());
88 } 88 }
89 89
90 // static 90 // static
91 const gfx::Display& ScreenUtil::GetSecondaryDisplay() { 91 const gfx::Display& ScreenUtil::GetSecondaryDisplay() {
92 DisplayManager* display_manager = GetDisplayManager(); 92 DisplayManager* display_manager = GetDisplayManager();
93 CHECK_LE(2U, display_manager->GetNumDisplays()); 93 CHECK_LE(2U, display_manager->GetNumDisplays());
94 return display_manager->GetDisplayAt(0).id() == 94 return display_manager->GetDisplayAt(0).id() ==
95 Shell::GetScreen()->GetPrimaryDisplay().id() ? 95 gfx::Screen::GetScreen()->GetPrimaryDisplay().id()
96 display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); 96 ? display_manager->GetDisplayAt(1)
97 : display_manager->GetDisplayAt(0);
97 } 98 }
98 99
99 } // namespace ash 100 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/shelf/overflow_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698