Chromium Code Reviews| Index: ash/wm/window_positioner.cc |
| =================================================================== |
| --- ash/wm/window_positioner.cc (revision 235803) |
| +++ 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,10 @@ |
| 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) { |
| + if (maximize_first_window || |
| + (work_area.width() <= GetForceMaximizedWidthLimit() && |
| + (!new_window || !wm::GetWindowState(new_window)->IsFullscreen()))) |
|
oshima
2013/11/19 17:58:26
why not single if?
ananta
2013/11/19 19:37:11
Done.
|
| *show_state_out = ui::SHOW_STATE_MAXIMIZED; |
| } |
| return; |
| @@ -415,6 +419,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) { |