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

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

Issue 11230050: ash : introduce second SessionStateController implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/session_state_animator.h" 5 #include "ash/wm/session_state_animator.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
10 #include "ui/compositor/layer_animation_sequence.h" 10 #include "ui/compositor/layer_animation_sequence.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 bool SessionStateAnimator::TestApi::ContainersAreAnimated( 133 bool SessionStateAnimator::TestApi::ContainersAreAnimated(
134 int container_mask, AnimationType type) const { 134 int container_mask, AnimationType type) const {
135 aura::Window::Windows containers; 135 aura::Window::Windows containers;
136 animator_->GetContainers(container_mask, &containers); 136 animator_->GetContainers(container_mask, &containers);
137 for (aura::Window::Windows::const_iterator it = containers.begin(); 137 for (aura::Window::Windows::const_iterator it = containers.begin();
138 it != containers.end(); ++it) { 138 it != containers.end(); ++it) {
139 aura::Window* window = *it; 139 aura::Window* window = *it;
140 ui::Layer* layer = window->layer(); 140 ui::Layer* layer = window->layer();
141 141
142 switch (type) { 142 switch (type) {
143 case ANIMATION_SLOW_CLOSE: 143 case ANIMATION_PARTIAL_CLOSE:
144 if (layer->GetTargetTransform() != GetSlowCloseTransform()) 144 if (layer->GetTargetTransform() != GetSlowCloseTransform())
145 return false; 145 return false;
146 break; 146 break;
147 case ANIMATION_UNDO_SLOW_CLOSE: 147 case ANIMATION_UNDO_PARTIAL_CLOSE:
148 if (layer->GetTargetTransform() != gfx::Transform()) 148 if (layer->GetTargetTransform() != gfx::Transform())
149 return false; 149 return false;
150 break; 150 break;
151 case ANIMATION_FAST_CLOSE: 151 case ANIMATION_FULL_CLOSE:
152 if (layer->GetTargetTransform() != GetFastCloseTransform() || 152 if (layer->GetTargetTransform() != GetFastCloseTransform() ||
153 layer->GetTargetOpacity() > 0.0001) 153 layer->GetTargetOpacity() > 0.0001)
154 return false; 154 return false;
155 break; 155 break;
156 case ANIMATION_FADE_IN: 156 case ANIMATION_FADE_IN:
157 if (layer->GetTargetOpacity() < 0.9999) 157 if (layer->GetTargetOpacity() < 0.9999)
158 return false; 158 return false;
159 break; 159 break;
160 case ANIMATION_HIDE: 160 case ANIMATION_HIDE:
161 if (layer->GetTargetOpacity() > 0.0001) 161 if (layer->GetTargetOpacity() > 0.0001)
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // Apply animation |type| to all containers described by |container_mask|. 254 // Apply animation |type| to all containers described by |container_mask|.
255 void SessionStateAnimator::StartAnimation(int container_mask, 255 void SessionStateAnimator::StartAnimation(int container_mask,
256 AnimationType type) { 256 AnimationType type) {
257 aura::Window::Windows containers; 257 aura::Window::Windows containers;
258 GetContainers(container_mask, &containers); 258 GetContainers(container_mask, &containers);
259 259
260 for (aura::Window::Windows::const_iterator it = containers.begin(); 260 for (aura::Window::Windows::const_iterator it = containers.begin();
261 it != containers.end(); ++it) { 261 it != containers.end(); ++it) {
262 aura::Window* window = *it; 262 aura::Window* window = *it;
263 switch (type) { 263 switch (type) {
264 case ANIMATION_SLOW_CLOSE: 264 case ANIMATION_PARTIAL_CLOSE:
265 StartSlowCloseAnimationForWindow(window); 265 StartSlowCloseAnimationForWindow(window);
266 break; 266 break;
267 case ANIMATION_UNDO_SLOW_CLOSE: 267 case ANIMATION_UNDO_PARTIAL_CLOSE:
268 StartUndoSlowCloseAnimationForWindow(window); 268 StartUndoSlowCloseAnimationForWindow(window);
269 break; 269 break;
270 case ANIMATION_FAST_CLOSE: 270 case ANIMATION_FULL_CLOSE:
271 StartFastCloseAnimationForWindow(window); 271 StartFastCloseAnimationForWindow(window);
272 break; 272 break;
273 case ANIMATION_FADE_IN: 273 case ANIMATION_FADE_IN:
274 FadeInWindow(window); 274 FadeInWindow(window);
275 break; 275 break;
276 case ANIMATION_HIDE: 276 case ANIMATION_HIDE:
277 HideWindow(window); 277 HideWindow(window);
278 break; 278 break;
279 case ANIMATION_RESTORE: 279 case ANIMATION_RESTORE:
280 RestoreWindow(window); 280 RestoreWindow(window);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 void SessionStateAnimator::ScheduleDropBlackLayer() { 314 void SessionStateAnimator::ScheduleDropBlackLayer() {
315 hide_black_layer_timer_.Stop(); 315 hide_black_layer_timer_.Stop();
316 hide_black_layer_timer_.Start( 316 hide_black_layer_timer_.Start(
317 FROM_HERE, 317 FROM_HERE,
318 base::TimeDelta::FromMilliseconds(kUndoSlowCloseAnimMs), 318 base::TimeDelta::FromMilliseconds(kUndoSlowCloseAnimMs),
319 this, &SessionStateAnimator::DropBlackLayer); 319 this, &SessionStateAnimator::DropBlackLayer);
320 } 320 }
321 321
322 } // namespace internal 322 } // namespace internal
323 } // namespace ash 323 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698