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

Unified Diff: ash/wm/window_positioner.cc

Issue 107273002: Merge 236134 "Ensure that the first browser window which is crea..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1700/src/
Patch Set: Created 7 years 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/window_positioner.h ('k') | ash/wm/window_positioner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_positioner.cc
===================================================================
--- ash/wm/window_positioner.cc (revision 239045)
+++ ash/wm/window_positioner.cc (working copy)
@@ -50,6 +50,9 @@
// WindowPositioner::SetIgnoreActivations().
static bool disable_auto_positioning = false;
+// If set to true, by default the first window in ASH will be maxmized.
+static bool maximize_first_window = false;
+
// Check if any management should be performed (with a given |window|).
bool UseAutoWindowManager(const aura::Window* window) {
if (disable_auto_positioning)
@@ -237,9 +240,9 @@
if (is_saved_bounds)
return;
// When using "small screens" we want to always open in full screen mode.
- if (show_state_in == ui::SHOW_STATE_DEFAULT &&
- work_area.width() <= GetForceMaximizedWidthLimit() &&
- (!new_window || !wm::GetWindowState(new_window)->IsFullscreen())) {
+ if (show_state_in == ui::SHOW_STATE_DEFAULT && (maximize_first_window ||
+ (work_area.width() <= GetForceMaximizedWidthLimit() &&
+ (!new_window || !wm::GetWindowState(new_window)->IsFullscreen())))) {
*show_state_out = ui::SHOW_STATE_MAXIMIZED;
}
return;
@@ -415,6 +418,11 @@
return NormalPopupPosition(old_pos, work_area);
}
+// static
+void WindowPositioner::SetMaximizeFirstWindow(bool maximize) {
+ maximize_first_window = maximize;
+}
+
gfx::Rect WindowPositioner::NormalPopupPosition(
const gfx::Rect& old_pos,
const gfx::Rect& work_area) {
« no previous file with comments | « ash/wm/window_positioner.h ('k') | ash/wm/window_positioner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698