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

Side by Side Diff: ui/views/animation/ink_drop_animation.cc

Issue 1944043002: Enabled tests to control material design ink drop animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Replaced unique_ptr with scoped_ptr. Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/views/animation/ink_drop_animation.h" 5 #include "ui/views/animation/ink_drop_animation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "ui/base/ui_base_switches.h" 10 #include "ui/base/ui_base_switches.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 target_ink_drop_state_ = InkDropState::ACTIVATED; 84 target_ink_drop_state_ = InkDropState::ACTIVATED;
85 animation_observer->SetActive(); 85 animation_observer->SetActive();
86 } 86 }
87 87
88 void InkDropAnimation::HideImmediately() { 88 void InkDropAnimation::HideImmediately() {
89 AbortAllAnimations(); 89 AbortAllAnimations();
90 SetStateToHidden(); 90 SetStateToHidden();
91 target_ink_drop_state_ = InkDropState::HIDDEN; 91 target_ink_drop_state_ = InkDropState::HIDDEN;
92 } 92 }
93 93
94 test::InkDropAnimationTestApi* InkDropAnimation::GetTestApi() {
95 return nullptr;
96 }
97
94 void InkDropAnimation::AnimationStartedCallback( 98 void InkDropAnimation::AnimationStartedCallback(
95 InkDropState ink_drop_state, 99 InkDropState ink_drop_state,
96 const ui::CallbackLayerAnimationObserver& observer) { 100 const ui::CallbackLayerAnimationObserver& observer) {
97 observer_->AnimationStarted(ink_drop_state); 101 observer_->AnimationStarted(ink_drop_state);
98 } 102 }
99 103
100 bool InkDropAnimation::AnimationEndedCallback( 104 bool InkDropAnimation::AnimationEndedCallback(
101 InkDropState ink_drop_state, 105 InkDropState ink_drop_state,
102 const ui::CallbackLayerAnimationObserver& observer) { 106 const ui::CallbackLayerAnimationObserver& observer) {
103 if (ink_drop_state == InkDropState::HIDDEN) 107 if (ink_drop_state == InkDropState::HIDDEN)
104 SetStateToHidden(); 108 SetStateToHidden();
105 observer_->AnimationEnded(ink_drop_state, 109 observer_->AnimationEnded(ink_drop_state,
106 observer.aborted_count() 110 observer.aborted_count()
107 ? InkDropAnimationEndedReason::PRE_EMPTED 111 ? InkDropAnimationEndedReason::PRE_EMPTED
108 : InkDropAnimationEndedReason::SUCCESS); 112 : InkDropAnimationEndedReason::SUCCESS);
109 // |this| may be deleted! 113 // |this| may be deleted!
110 return true; 114 return true;
111 } 115 }
112 116
113 } // namespace views 117 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_animation.h ('k') | ui/views/animation/ink_drop_animation_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698