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

Side by Side Diff: ash/wm/window_positioner.cc

Issue 62333015: Ensure that the first browser window which is created in Windows 8 ASH is maximized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_positioner.h" 5 #include "ash/wm/window_positioner.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // and show state. 231 // and show state.
232 if (!top_window) { 232 if (!top_window) {
233 gfx::Rect work_area = screen->GetDisplayNearestWindow(target).work_area(); 233 gfx::Rect work_area = screen->GetDisplayNearestWindow(target).work_area();
234 234
235 bounds_in_out->AdjustToFit(work_area); 235 bounds_in_out->AdjustToFit(work_area);
236 // Use adjusted saved bounds, if there is one. 236 // Use adjusted saved bounds, if there is one.
237 if (is_saved_bounds) 237 if (is_saved_bounds)
238 return; 238 return;
239 // When using "small screens" we want to always open in full screen mode. 239 // When using "small screens" we want to always open in full screen mode.
240 if (show_state_in == ui::SHOW_STATE_DEFAULT && 240 if (show_state_in == ui::SHOW_STATE_DEFAULT &&
241 #if !defined(OS_WIN)
241 work_area.width() <= GetForceMaximizedWidthLimit() && 242 work_area.width() <= GetForceMaximizedWidthLimit() &&
243 #endif
242 (!new_window || !wm::GetWindowState(new_window)->IsFullscreen())) { 244 (!new_window || !wm::GetWindowState(new_window)->IsFullscreen())) {
243 *show_state_out = ui::SHOW_STATE_MAXIMIZED; 245 *show_state_out = ui::SHOW_STATE_MAXIMIZED;
244 } 246 }
245 return; 247 return;
246 } 248 }
247 bool maximized = wm::GetWindowState(top_window)->IsMaximized(); 249 bool maximized = wm::GetWindowState(top_window)->IsMaximized();
248 // We ignore the saved show state, but look instead for the top level 250 // We ignore the saved show state, but look instead for the top level
249 // window's show state. 251 // window's show state.
250 if (show_state_in == ui::SHOW_STATE_DEFAULT) { 252 if (show_state_in == ui::SHOW_STATE_DEFAULT) {
251 *show_state_out = maximized ? ui::SHOW_STATE_MAXIMIZED : 253 *show_state_out = maximized ? ui::SHOW_STATE_MAXIMIZED :
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // If the alignment was pushing the window out of the screen, we ignore the 533 // If the alignment was pushing the window out of the screen, we ignore the
532 // alignment for that call. 534 // alignment for that call.
533 if (abs(pos.right() - work_area.right()) < grid) 535 if (abs(pos.right() - work_area.right()) < grid)
534 x = work_area.right() - w; 536 x = work_area.right() - w;
535 if (abs(pos.bottom() - work_area.bottom()) < grid) 537 if (abs(pos.bottom() - work_area.bottom()) < grid)
536 y = work_area.bottom() - h; 538 y = work_area.bottom() - h;
537 return gfx::Rect(x, y, w, h); 539 return gfx::Rect(x, y, w, h);
538 } 540 }
539 541
540 } // namespace ash 542 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/window_positioner_unittest.cc » ('j') | chrome/browser/ui/window_sizer/window_sizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698