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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 130983007: Creating multi profile animations for switching users and teleporting of windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 3f22fced9ea06879bb0126486b7c29cbfebfe92f..97732eea34010c0663445a84f906637473513df0 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -207,7 +207,8 @@ ShelfLayoutManager::ShelfLayoutManager(ShelfWidget* shelf)
gesture_drag_status_(GESTURE_DRAG_NONE),
gesture_drag_amount_(0.f),
gesture_drag_auto_hide_state_(SHELF_AUTO_HIDE_SHOWN),
- update_shelf_observer_(NULL) {
+ update_shelf_observer_(NULL),
+ duration_override_in_ms_(0) {
Shell::GetInstance()->AddShellObserver(this);
Shell::GetInstance()->lock_state_controller()->AddObserver(this);
aura::client::GetActivationClient(root_window_)->AddObserver(this);
@@ -493,6 +494,11 @@ void ShelfLayoutManager::CancelGestureDrag() {
gesture_drag_status_ = GESTURE_DRAG_NONE;
}
+void ShelfLayoutManager::SetAnimationDurationOverride(
+ int duration_override_in_ms) {
+ duration_override_in_ms_ = duration_override_in_ms;
+}
+
////////////////////////////////////////////////////////////////////////////////
// ShelfLayoutManager, aura::LayoutManager implementation:
@@ -655,13 +661,15 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity(
ui::ScopedLayerAnimationSettings status_animation_setter(
GetLayer(shelf_->status_area_widget())->GetAnimator());
if (animate) {
+ int duration = duration_override_in_ms_ ? duration_override_in_ms_ :
+ kCrossFadeDurationMS;
shelf_animation_setter.SetTransitionDuration(
- base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS));
+ base::TimeDelta::FromMilliseconds(duration));
shelf_animation_setter.SetTweenType(gfx::Tween::EASE_OUT);
shelf_animation_setter.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
status_animation_setter.SetTransitionDuration(
- base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS));
+ base::TimeDelta::FromMilliseconds(duration));
status_animation_setter.SetTweenType(gfx::Tween::EASE_OUT);
status_animation_setter.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);

Powered by Google App Engine
This is Rietveld 408576698