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

Unified Diff: ash/wm/window_util.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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/wm/system_modal_container_layout_manager.cc ('k') | ash/wm/workspace/workspace_layout_manager2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 8b9dcb0202f1384848da9e17043f7c0b13a21490..55513af6c4e147f7c0e4c0f76a1a18c9ad05efca 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -110,7 +110,8 @@ void ToggleMaximizedWindow(aura::Window* window) {
void CenterWindow(aura::Window* window) {
const gfx::Display display =
Shell::GetScreen()->GetDisplayNearestWindow(window);
- gfx::Rect center = display.work_area().Center(window->bounds().size());
+ gfx::Rect center = display.work_area();
+ center.ClampToCenteredSize(window->bounds().size());
window->SetBounds(center);
}
« no previous file with comments | « ash/wm/system_modal_container_layout_manager.cc ('k') | ash/wm/workspace/workspace_layout_manager2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698