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

Unified Diff: chrome/browser/ui/window_sizer_ash.cc

Issue 9969164: Ignoring alignment when it pushes a window out of the screen (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Not my code anymore 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: chrome/browser/ui/window_sizer_ash.cc
diff --git a/chrome/browser/ui/window_sizer_ash.cc b/chrome/browser/ui/window_sizer_ash.cc
index 561316fb966e3b95df7c102849c905797e2571d0..45c4b7fc22673357db5c274892f7a0a4040d83a1 100644
--- a/chrome/browser/ui/window_sizer_ash.cc
+++ b/chrome/browser/ui/window_sizer_ash.cc
@@ -107,10 +107,14 @@ void WindowSizer::GetDefaultWindowBounds(gfx::Rect* default_bounds) const {
// There should also be a 'desktop' border around the window at the top.
// Since the workspace excludes the tray area we only need one border size.
int default_height = work_area.height() - kDesktopBorderSize;
+ // We align the size to the grid size to avoid any surprise when the
+ // monitor height isn't divide-able by our alignment factor.
+ default_width -= default_width % kDesktopBorderSize;
+ default_height -= default_height % kDesktopBorderSize;
int offset_x = kDesktopBorderSize;
int maximum_window_width = 1280;
if (default_width > maximum_window_width) {
- // The window should get centered on the screen as well.
+ // The window should get centered on the screen and not follow the grid.
offset_x = (work_area.width() - maximum_window_width) / 2;
// Never make a window wider then 1280.
default_width = maximum_window_width;
« no previous file with comments | « chrome/browser/ui/views/ash/window_positioner_unittest.cc ('k') | chrome/browser/ui/window_sizer_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698