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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 89f24ab9f9115913afb27cd4dcdab4ebfcf7464d..df054be370dc7b4d8f94c25f99db9b26de5df2a9 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -212,7 +212,8 @@ gfx::Rect WorkspaceWindowResizer::GetFinalBounds(
void WorkspaceWindowResizer::LayoutAttachedWindows(
const gfx::Rect& bounds,
int grid_size) {
- gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaNearestWindow(window()));
+ gfx::Rect work_area(
+ gfx::Screen::GetMonitorNearestWindow(window()).work_area());
std::vector<int> sizes;
CalculateAttachedSizes(
PrimaryAxisSize(details_.initial_bounds.size()),
@@ -281,7 +282,8 @@ void WorkspaceWindowResizer::CalculateAttachedSizes(
void WorkspaceWindowResizer::AdjustBoundsForMainWindow(
gfx::Rect* bounds, int grid_size) const {
// Always keep kMinOnscreenHeight on the bottom.
- gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaNearestWindow(window()));
+ gfx::Rect work_area(
+ gfx::Screen::GetMonitorNearestWindow(window()).work_area());
int max_y = AlignToGridRoundUp(work_area.bottom() - kMinOnscreenHeight,
grid_size);
if (bounds->y() > max_y)
@@ -335,7 +337,7 @@ void WorkspaceWindowResizer::SnapToWorkAreaEdges(
bool WorkspaceWindowResizer::TouchesBottomOfScreen() const {
gfx::Rect work_area(
- gfx::Screen::GetMonitorWorkAreaNearestWindow(details_.window));
+ gfx::Screen::GetMonitorNearestWindow(details_.window).work_area());
return (attached_windows_.empty() &&
details_.window->bounds().bottom() == work_area.bottom()) ||
(!attached_windows_.empty() &&
@@ -422,7 +424,8 @@ WorkspaceWindowResizer::SnapType WorkspaceWindowResizer::GetSnapType(
const gfx::Point& location) const {
// TODO: this likely only wants total monitor area, not the area of a single
// monitor.
- gfx::Rect area(gfx::Screen::GetMonitorAreaNearestWindow(details_.window));
+ gfx::Rect area(
+ gfx::Screen::GetMonitorNearestWindow(details_.window).bounds());
if (location.x() <= area.x())
return SNAP_LEFT_EDGE;
if (location.x() >= area.right() - 1)
« no previous file with comments | « ash/wm/workspace/workspace_manager_unittest.cc ('k') | chrome/browser/chromeos/input_method/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698