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

Side by Side Diff: ash/wm/overview/scoped_transform_overview_window.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
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/overview/scoped_transform_overview_window.h" 5 #include "ash/wm/overview/scoped_transform_overview_window.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/wm/overview/scoped_window_copy.h" 9 #include "ash/wm/overview/scoped_window_copy.h"
10 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return result; 58 return result;
59 } 59 }
60 60
61 void SetTransformOnWindowAndAllTransientChildren( 61 void SetTransformOnWindowAndAllTransientChildren(
62 aura::Window* window, 62 aura::Window* window,
63 const gfx::Transform& transform, 63 const gfx::Transform& transform,
64 bool animate) { 64 bool animate) {
65 SetTransformOnWindow(window, transform, animate); 65 SetTransformOnWindow(window, transform, animate);
66 66
67 aura::Window::Windows transient_children = 67 aura::Window::Windows transient_children =
68 views::corewm::GetTransientChildren(window); 68 ::wm::GetTransientChildren(window);
69 for (aura::Window::Windows::iterator iter = transient_children.begin(); 69 for (aura::Window::Windows::iterator iter = transient_children.begin();
70 iter != transient_children.end(); ++iter) { 70 iter != transient_children.end(); ++iter) {
71 aura::Window* transient_child = *iter; 71 aura::Window* transient_child = *iter;
72 gfx::Rect window_bounds = window->bounds(); 72 gfx::Rect window_bounds = window->bounds();
73 gfx::Rect child_bounds = transient_child->bounds(); 73 gfx::Rect child_bounds = transient_child->bounds();
74 gfx::Transform transient_window_transform( 74 gfx::Transform transient_window_transform(
75 TranslateTransformOrigin(child_bounds.origin() - window_bounds.origin(), 75 TranslateTransformOrigin(child_bounds.origin() - window_bounds.origin(),
76 transform)); 76 transform));
77 SetTransformOnWindow(transient_child, transient_window_transform, animate); 77 SetTransformOnWindow(transient_child, transient_window_transform, animate);
78 } 78 }
79 } 79 }
80 80
81 aura::Window* GetModalTransientParent(aura::Window* window) { 81 aura::Window* GetModalTransientParent(aura::Window* window) {
82 if (window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_WINDOW) 82 if (window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_WINDOW)
83 return views::corewm::GetTransientParent(window); 83 return ::wm::GetTransientParent(window);
84 return NULL; 84 return NULL;
85 } 85 }
86 86
87 } // namespace 87 } // namespace
88 88
89 const int ScopedTransformOverviewWindow::kTransitionMilliseconds = 200; 89 const int ScopedTransformOverviewWindow::kTransitionMilliseconds = 200;
90 90
91 ScopedTransformOverviewWindow::ScopedTransformOverviewWindow( 91 ScopedTransformOverviewWindow::ScopedTransformOverviewWindow(
92 aura::Window* window) 92 aura::Window* window)
93 : window_(window), 93 : window_(window),
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if (modal_parent) 232 if (modal_parent)
233 CopyWindowAndTransientParents(target_root, modal_parent); 233 CopyWindowAndTransientParents(target_root, modal_parent);
234 window_copies_.push_back(new ScopedWindowCopy(target_root, window)); 234 window_copies_.push_back(new ScopedWindowCopy(target_root, window));
235 } 235 }
236 236
237 void ScopedTransformOverviewWindow::SetTransformOnWindowAndTransientChildren( 237 void ScopedTransformOverviewWindow::SetTransformOnWindowAndTransientChildren(
238 const gfx::Transform& transform, 238 const gfx::Transform& transform,
239 bool animate) { 239 bool animate) {
240 gfx::Point origin(GetBoundsInScreen().origin()); 240 gfx::Point origin(GetBoundsInScreen().origin());
241 aura::Window* window = window_; 241 aura::Window* window = window_;
242 while (views::corewm::GetTransientParent(window)) 242 while (::wm::GetTransientParent(window))
243 window = views::corewm::GetTransientParent(window); 243 window = ::wm::GetTransientParent(window);
244 for (ScopedVector<ScopedWindowCopy>::const_iterator iter = 244 for (ScopedVector<ScopedWindowCopy>::const_iterator iter =
245 window_copies_.begin(); iter != window_copies_.end(); ++iter) { 245 window_copies_.begin(); iter != window_copies_.end(); ++iter) {
246 SetTransformOnWindow( 246 SetTransformOnWindow(
247 (*iter)->GetWindow(), 247 (*iter)->GetWindow(),
248 TranslateTransformOrigin(ScreenUtil::ConvertRectToScreen( 248 TranslateTransformOrigin(ScreenUtil::ConvertRectToScreen(
249 (*iter)->GetWindow()->parent(), 249 (*iter)->GetWindow()->parent(),
250 (*iter)->GetWindow()->GetTargetBounds()).origin() - origin, 250 (*iter)->GetWindow()->GetTargetBounds()).origin() - origin,
251 transform), 251 transform),
252 animate); 252 animate);
253 } 253 }
254 SetTransformOnWindowAndAllTransientChildren( 254 SetTransformOnWindowAndAllTransientChildren(
255 window, 255 window,
256 TranslateTransformOrigin(ScreenUtil::ConvertRectToScreen( 256 TranslateTransformOrigin(ScreenUtil::ConvertRectToScreen(
257 window->parent(), window->GetTargetBounds()).origin() - origin, 257 window->parent(), window->GetTargetBounds()).origin() - origin,
258 transform), 258 transform),
259 animate); 259 animate);
260 } 260 }
261 261
262 void ScopedTransformOverviewWindow::PrepareForOverview() { 262 void ScopedTransformOverviewWindow::PrepareForOverview() {
263 DCHECK(!overview_started_); 263 DCHECK(!overview_started_);
264 overview_started_ = true; 264 overview_started_ = true;
265 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(true); 265 ash::wm::GetWindowState(window_)->set_ignored_by_shelf(true);
266 RestoreWindow(); 266 RestoreWindow();
267 } 267 }
268 268
269 } // namespace ash 269 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/maximize_mode/workspace_backdrop_delegate.cc ('k') | ash/wm/overview/scoped_window_copy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698