Chromium Code Reviews| Index: chrome/browser/ui/window_sizer/window_sizer_ash.cc |
| diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash.cc b/chrome/browser/ui/window_sizer/window_sizer_ash.cc |
| index f3109e212c7d1511b84c1caa0a964cc05afc22a9..aa81531e41565279a50fcb78251bdb79e9f0f0df 100644 |
| --- a/chrome/browser/ui/window_sizer/window_sizer_ash.cc |
| +++ b/chrome/browser/ui/window_sizer/window_sizer_ash.cc |
| @@ -4,9 +4,11 @@ |
| #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| +#include "ash/ash_switches.h" |
| #include "ash/shell.h" |
| #include "ash/wm/window_cycle_controller.h" |
| #include "ash/wm/window_util.h" |
| +#include "base/command_line.h" |
| #include "base/compiler_specific.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/ui/browser.h" |
| @@ -22,8 +24,10 @@ |
| namespace { |
| // When a window gets opened in default mode and the screen is less then this |
| -// width, the window will get opened in maximized mode. |
| +// width, the window will get opened in maximized mode. This value can be |
| +// reduced to a "tame" number if the feature is disabled. |
| const int kForceMaximizeWidthLimit = 1366; |
| +const int kForceMaximizeWidthLimitDisabled = 640; |
| // Check if the given browser is 'valid': It is a tabbed, non minimized |
| // window, which intersects with the |bounds_in_screen| area of a given screen. |
| @@ -135,7 +139,13 @@ bool MoveRect(const gfx::Rect& work_area, |
| // static |
| int WindowSizer::GetForceMaximizedWidthLimit() { |
| - return kForceMaximizeWidthLimit; |
| + static int maximum_limit = 0; |
| + if (!maximum_limit) { |
| + maximum_limit = CommandLine::ForCurrentProcess()->HasSwitch( |
| + ash::switches::kAshDisableAutoMaximizing) ? |
| + kForceMaximizeWidthLimitDisabled : kForceMaximizeWidthLimit; |
|
James Cook
2013/04/13 00:15:03
Is there a way to actually disable the code that e
skuhne
2013/04/13 00:21:29
1) LOL - yeah right. I have thought about doing it
|
| + } |
| + return maximum_limit; |
| } |
| bool WindowSizer::GetBoundsOverrideAsh(gfx::Rect* bounds_in_screen, |