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

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

Issue 14222010: Add a maximizing logic flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e4ed3740c7622e4c83d164d68f76577b593a5609 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;
+ }
+ return maximum_limit;
}
bool WindowSizer::GetBoundsOverrideAsh(gfx::Rect* bounds_in_screen,
@@ -172,7 +182,7 @@ bool WindowSizer::GetBoundsOverrideAsh(gfx::Rect* bounds_in_screen,
// When using "small screens" we want to always open in full screen mode.
if (passed_show_state == ui::SHOW_STATE_DEFAULT &&
!browser_->is_session_restore() &&
- work_area.width() < kForceMaximizeWidthLimit &&
+ work_area.width() < GetForceMaximizedWidthLimit() &&
(!browser_->window() || !browser_->window()->IsFullscreen()) &&
(!browser_->fullscreen_controller() ||
!browser_->fullscreen_controller()->IsFullscreenForBrowser()))
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698