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

Side by Side Diff: ui/aura_shell/window_util.cc

Issue 8895003: Aura: Add --aura-laptop-mode to fill the workspace with a single window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maximize ALL the windows Created 9 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 unified diff | Download patch | Annotate | Revision Log
« ui/aura_shell/shell.cc ('K') | « ui/aura_shell/window_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura_shell/window_util.h" 5 #include "ui/aura_shell/window_util.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura_shell/property_util.h"
9 #include "ui/base/ui_base_types.h" 10 #include "ui/base/ui_base_types.h"
11 #include "ui/gfx/screen.h"
10 12
11 namespace aura_shell { 13 namespace aura_shell {
14 namespace window_util {
12 15
13 bool IsWindowMaximized(aura::Window* window) { 16 bool IsWindowMaximized(aura::Window* window) {
14 return window->GetIntProperty(aura::kShowStateKey) == 17 return window->GetIntProperty(aura::kShowStateKey) ==
15 ui::SHOW_STATE_MAXIMIZED; 18 ui::SHOW_STATE_MAXIMIZED;
16 } 19 }
17 20
21 void UpdateBoundsFromShowState(aura::Window* window) {
22 switch (window->GetIntProperty(aura::kShowStateKey)) {
23 case ui::SHOW_STATE_NORMAL: {
24 const gfx::Rect* restore = GetRestoreBounds(window);
25 window->SetProperty(aura::kRestoreBoundsKey, NULL);
26 if (restore)
27 window->SetBounds(*restore);
28 delete restore;
29 break;
30 }
31
32 case ui::SHOW_STATE_MAXIMIZED:
33 SetRestoreBoundsIfNotSet(window);
34 window->SetBounds(gfx::Screen::GetMonitorWorkAreaNearestWindow(window));
35 break;
36
37 case ui::SHOW_STATE_FULLSCREEN:
38 SetRestoreBoundsIfNotSet(window);
39 window->SetBounds(gfx::Screen::GetMonitorAreaNearestWindow(window));
40 break;
41
42 default:
43 break;
44 }
45 }
46
47 } // namespace window_util
18 } // namespace aura_shell 48 } // namespace aura_shell
OLDNEW
« ui/aura_shell/shell.cc ('K') | « ui/aura_shell/window_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698