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

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

Issue 196063002: Move wm/core to wm namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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/window_modality_controller_unittest.cc ('k') | ash/wm/window_state.cc » ('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 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_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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 return false; 108 return false;
109 } 109 }
110 110
111 // Move a |window| to a new |bound|. Animate if desired by user. 111 // Move a |window| to a new |bound|. Animate if desired by user.
112 // Note: The function will do nothing if the bounds did not change. 112 // Note: The function will do nothing if the bounds did not change.
113 void SetBoundsAnimated(aura::Window* window, const gfx::Rect& bounds) { 113 void SetBoundsAnimated(aura::Window* window, const gfx::Rect& bounds) {
114 if (bounds == window->GetTargetBounds()) 114 if (bounds == window->GetTargetBounds())
115 return; 115 return;
116 116
117 if (views::corewm::WindowAnimationsDisabled(window)) { 117 if (::wm::WindowAnimationsDisabled(window)) {
118 window->SetBounds(bounds); 118 window->SetBounds(bounds);
119 return; 119 return;
120 } 120 }
121 121
122 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); 122 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
123 settings.SetTransitionDuration( 123 settings.SetTransitionDuration(
124 base::TimeDelta::FromMilliseconds(kWindowAutoMoveDurationMS)); 124 base::TimeDelta::FromMilliseconds(kWindowAutoMoveDurationMS));
125 window->SetBounds(bounds); 125 window->SetBounds(bounds);
126 } 126 }
127 127
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 // If the alignment was pushing the window out of the screen, we ignore the 529 // If the alignment was pushing the window out of the screen, we ignore the
530 // alignment for that call. 530 // alignment for that call.
531 if (abs(pos.right() - work_area.right()) < grid) 531 if (abs(pos.right() - work_area.right()) < grid)
532 x = work_area.right() - w; 532 x = work_area.right() - w;
533 if (abs(pos.bottom() - work_area.bottom()) < grid) 533 if (abs(pos.bottom() - work_area.bottom()) < grid)
534 y = work_area.bottom() - h; 534 y = work_area.bottom() - h;
535 return gfx::Rect(x, y, w, h); 535 return gfx::Rect(x, y, w, h);
536 } 536 }
537 537
538 } // namespace ash 538 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_modality_controller_unittest.cc ('k') | ash/wm/window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698