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

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

Issue 224113005: Eliminate ash::internal namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/boot_splash_screen_chromeos.cc ('k') | ash/wm/dock/dock_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/default_state.h" 5 #include "ash/wm/default_state.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/screen_util.h" 8 #include "ash/screen_util.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 13 matching lines...) Expand all
24 namespace ash { 24 namespace ash {
25 namespace wm { 25 namespace wm {
26 namespace { 26 namespace {
27 27
28 // This specifies how much percent (30%) of a window rect 28 // This specifies how much percent (30%) of a window rect
29 // must be visible when the window is added to the workspace. 29 // must be visible when the window is added to the workspace.
30 const float kMinimumPercentOnScreenArea = 0.3f; 30 const float kMinimumPercentOnScreenArea = 0.3f;
31 31
32 bool IsPanel(aura::Window* window) { 32 bool IsPanel(aura::Window* window) {
33 return window->parent() && 33 return window->parent() &&
34 window->parent()->id() == internal::kShellWindowId_PanelContainer; 34 window->parent()->id() == kShellWindowId_PanelContainer;
35 } 35 }
36 36
37 void MoveToDisplayForRestore(WindowState* window_state) { 37 void MoveToDisplayForRestore(WindowState* window_state) {
38 if (!window_state->HasRestoreBounds()) 38 if (!window_state->HasRestoreBounds())
39 return; 39 return;
40 const gfx::Rect& restore_bounds = window_state->GetRestoreBoundsInScreen(); 40 const gfx::Rect& restore_bounds = window_state->GetRestoreBoundsInScreen();
41 41
42 // Move only if the restore bounds is outside of 42 // Move only if the restore bounds is outside of
43 // the display. There is no information about in which 43 // the display. There is no information about in which
44 // display it should be restored, so this is best guess. 44 // display it should be restored, so this is best guess.
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window); 596 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window);
597 center_in_parent.ClampToCenteredSize(window->bounds().size()); 597 center_in_parent.ClampToCenteredSize(window->bounds().size());
598 window_state->SetBoundsDirectAnimated(center_in_parent); 598 window_state->SetBoundsDirectAnimated(center_in_parent);
599 } 599 }
600 // Centering window is treated as if a user moved and resized the window. 600 // Centering window is treated as if a user moved and resized the window.
601 window_state->set_bounds_changed_by_user(true); 601 window_state->set_bounds_changed_by_user(true);
602 } 602 }
603 603
604 } // namespace wm 604 } // namespace wm
605 } // namespace ash 605 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/boot_splash_screen_chromeos.cc ('k') | ash/wm/dock/dock_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698