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

Side by Side Diff: ash/wm/overview/scoped_transform_overview_window.cc

Issue 138003007: [Cleanup] Screen cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make sure screen_for_shutdown is reset everytime Created 6 years, 11 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_ash.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"
11 #include "ui/aura/client/aura_constants.h" 11 #include "ui/aura/client/aura_constants.h"
12 #include "ui/aura/client/screen_position_client.h" 12 #include "ui/aura/client/screen_position_client.h"
13 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
14 #include "ui/compositor/scoped_layer_animation_settings.h" 14 #include "ui/compositor/scoped_layer_animation_settings.h"
15 #include "ui/gfx/animation/tween.h" 15 #include "ui/gfx/animation/tween.h"
16 #include "ui/views/corewm/window_animations.h" 16 #include "ui/views/corewm/window_animations.h"
17 #include "ui/views/corewm/window_util.h" 17 #include "ui/views/corewm/window_util.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return true; 132 return true;
133 window = GetModalTransientParent(window); 133 window = GetModalTransientParent(window);
134 } 134 }
135 return false; 135 return false;
136 } 136 }
137 137
138 gfx::Rect ScopedTransformOverviewWindow::GetBoundsInScreen() const { 138 gfx::Rect ScopedTransformOverviewWindow::GetBoundsInScreen() const {
139 gfx::Rect bounds; 139 gfx::Rect bounds;
140 aura::Window* window = window_; 140 aura::Window* window = window_;
141 while (window) { 141 while (window) {
142 bounds.Union(ScreenAsh::ConvertRectToScreen(window->parent(), 142 bounds.Union(ScreenUtil::ConvertRectToScreen(window->parent(),
143 window->GetTargetBounds())); 143 window->GetTargetBounds()));
144 window = GetModalTransientParent(window); 144 window = GetModalTransientParent(window);
145 } 145 }
146 return bounds; 146 return bounds;
147 } 147 }
148 148
149 void ScopedTransformOverviewWindow::RestoreWindow() { 149 void ScopedTransformOverviewWindow::RestoreWindow() {
150 if (minimized_ && window_->GetProperty(aura::client::kShowStateKey) == 150 if (minimized_ && window_->GetProperty(aura::client::kShowStateKey) ==
151 ui::SHOW_STATE_MINIMIZED) { 151 ui::SHOW_STATE_MINIMIZED) {
152 window_->Show(); 152 window_->Show();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (views::corewm::GetTransientParent(window))
243 window = views::corewm::GetTransientParent(window); 243 window = views::corewm::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(ScreenAsh::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(ScreenAsh::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/immersive_fullscreen_controller_unittest.cc ('k') | ash/wm/overview/scoped_window_copy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698