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

Side by Side Diff: ash/wm/window_resizer.cc

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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/video_detector.cc ('k') | ash/wm/workspace/frame_maximize_button.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/window_resizer.h" 5 #include "ash/wm/window_resizer.h"
6 6
7 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/root_window.h" 10 #include "ui/aura/root_window.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 gfx::Size size = GetSizeForDrag(details, &delta_x, &delta_y, grid_size); 197 gfx::Size size = GetSizeForDrag(details, &delta_x, &delta_y, grid_size);
198 gfx::Point origin = GetOriginForDrag(details, delta_x, delta_y); 198 gfx::Point origin = GetOriginForDrag(details, delta_x, delta_y);
199 199
200 gfx::Rect new_bounds(origin, size); 200 gfx::Rect new_bounds(origin, size);
201 // Update bottom edge to stay in the work area when we are resizing 201 // Update bottom edge to stay in the work area when we are resizing
202 // by dragging the bottome edge or corners. 202 // by dragging the bottome edge or corners.
203 if (details.window_component == HTBOTTOM || 203 if (details.window_component == HTBOTTOM ||
204 details.window_component == HTBOTTOMRIGHT || 204 details.window_component == HTBOTTOMRIGHT ||
205 details.window_component == HTBOTTOMLEFT) { 205 details.window_component == HTBOTTOMLEFT) {
206 gfx::Rect work_area = 206 gfx::Rect work_area =
207 ScreenAsh::GetDisplayWorkAreaParentBounds(details.window); 207 ScreenAsh::GetDisplayWorkAreaBoundsInParent(details.window);
208 if (new_bounds.bottom() > work_area.bottom()) 208 if (new_bounds.bottom() > work_area.bottom())
209 new_bounds.Inset(0, 0, 0, 209 new_bounds.Inset(0, 0, 0,
210 new_bounds.bottom() - work_area.bottom()); 210 new_bounds.bottom() - work_area.bottom());
211 } 211 }
212 if (details.bounds_change & kBoundsChange_Resizes && 212 if (details.bounds_change & kBoundsChange_Resizes &&
213 details.bounds_change & kBoundsChange_Repositions && new_bounds.y() < 0) { 213 details.bounds_change & kBoundsChange_Repositions && new_bounds.y() < 0) {
214 int delta = new_bounds.y(); 214 int delta = new_bounds.y();
215 new_bounds.set_y(0); 215 new_bounds.set_y(0);
216 new_bounds.set_height(new_bounds.height() + delta); 216 new_bounds.set_height(new_bounds.height() + delta);
217 } 217 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 gfx::Screen::GetDisplayNearestWindow(details.window).bounds().height(); 332 gfx::Screen::GetDisplayNearestWindow(details.window).bounds().height();
333 if (height > max_height) { 333 if (height > max_height) {
334 height = max_height; 334 height = max_height;
335 *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height); 335 *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height);
336 } 336 }
337 } 337 }
338 return height; 338 return height;
339 } 339 }
340 340
341 } // namespace aura 341 } // namespace aura
OLDNEW
« no previous file with comments | « ash/wm/video_detector.cc ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698