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

Unified Diff: ash/display/screen_position_controller.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/screen_ash_unittest.cc ('k') | ash/display/screen_position_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/screen_position_controller.cc
diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc
index 9503fd448c02605415238f18d372f80dc709c3b0..2c146a8aa294a1ed18d8ab7c4e29f276bdf02ef5 100644
--- a/ash/display/screen_position_controller.cc
+++ b/ash/display/screen_position_controller.cc
@@ -123,8 +123,11 @@ void ScreenPositionController::ConvertPointToScreen(
gfx::Point* point) {
const aura::Window* root = window->GetRootWindow();
aura::Window::ConvertPointToTarget(window, root, point);
- const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow(
- const_cast<aura::Window*>(root)).bounds().origin();
+ const gfx::Point display_origin =
+ gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(const_cast<aura::Window*>(root))
+ .bounds()
+ .origin();
point->Offset(display_origin.x(), display_origin.y());
}
@@ -132,8 +135,11 @@ void ScreenPositionController::ConvertPointFromScreen(
const aura::Window* window,
gfx::Point* point) {
const aura::Window* root = window->GetRootWindow();
- const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow(
- const_cast<aura::Window*>(root)).bounds().origin();
+ const gfx::Point display_origin =
+ gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(const_cast<aura::Window*>(root))
+ .bounds()
+ .origin();
point->Offset(-display_origin.x(), -display_origin.y());
aura::Window::ConvertPointToTarget(root, window, point);
}
@@ -222,8 +228,10 @@ void ScreenPositionController::SetBounds(aura::Window* window,
}
}
gfx::Point origin(bounds.origin());
- const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow(
- window).bounds().origin();
+ const gfx::Point display_origin = gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(window)
+ .bounds()
+ .origin();
origin.Offset(-display_origin.x(), -display_origin.y());
window->SetBounds(gfx::Rect(origin, bounds.size()));
}
« no previous file with comments | « ash/display/screen_ash_unittest.cc ('k') | ash/display/screen_position_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698