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

Side by Side Diff: ash/wm/workspace/snap_sizer.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/workspace/maximized_workspace.cc ('k') | ash/wm/workspace/workspace_event_filter.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/wm/workspace/snap_sizer.h" 5 #include "ash/wm/workspace/snap_sizer.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "ash/screen_ash.h" 9 #include "ash/screen_ash.h"
10 #include "ash/wm/window_resizer.h" 10 #include "ash/wm/window_resizer.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return gfx::Rect(x, y, mid_x - x, max_y - y); 107 return gfx::Rect(x, y, mid_x - x, max_y - y);
108 } 108 }
109 int max_x = 109 int max_x =
110 WindowResizer::AlignToGridRoundDown(work_area.right(), grid_size_); 110 WindowResizer::AlignToGridRoundDown(work_area.right(), grid_size_);
111 int x = WindowResizer::AlignToGridRoundUp(max_x - width, grid_size_); 111 int x = WindowResizer::AlignToGridRoundUp(max_x - width, grid_size_);
112 return gfx::Rect(x , y, max_x - x, max_y - y); 112 return gfx::Rect(x , y, max_x - x, max_y - y);
113 } 113 }
114 114
115 bool SnapSizer::AlongEdge(int x) const { 115 bool SnapSizer::AlongEdge(int x) const {
116 // TODO: need to support multi-monitor. 116 // TODO: need to support multi-monitor.
117 gfx::Rect area(gfx::Screen::GetMonitorAreaNearestWindow(window_)); 117 gfx::Rect area(gfx::Screen::GetMonitorNearestWindow(window_).bounds());
118 return (x <= area.x()) || (x >= area.right() - 1); 118 return (x <= area.x()) || (x >= area.right() - 1);
119 } 119 }
120 120
121 } // namespace internal 121 } // namespace internal
122 } // namespace ash 122 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/maximized_workspace.cc ('k') | ash/wm/workspace/workspace_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698