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

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 9320018: Revert 120092 - Reland 120074 -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « ash/drag_drop/drag_drop_controller.h ('k') | ash/test/aura_shell_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/drag_drop/drag_drop_controller.cc
===================================================================
--- ash/drag_drop/drag_drop_controller.cc (revision 120096)
+++ ash/drag_drop/drag_drop_controller.cc (working copy)
@@ -28,7 +28,7 @@
const gfx::Point kDragDropWidgetOffset(0, 0);
const base::TimeDelta kDragDropAnimationDuration =
base::TimeDelta::FromMilliseconds(250);
-} // namespace
+}
////////////////////////////////////////////////////////////////////////////////
// DragDropController, public:
@@ -47,8 +47,11 @@
DragDropController::~DragDropController() {
Shell::GetInstance()->RemoveRootWindowEventFilter(this);
Cleanup();
- if (drag_image_.get())
+ if (drag_image_.get()) {
+ aura::Window* window = drag_image_->GetWidget()->GetNativeView();
+ window->layer()->GetAnimator()->RemoveObserver(this);
drag_image_.reset();
+ }
}
int DragDropController::StartDragAndDrop(const ui::OSExchangeData& data,
@@ -203,23 +206,26 @@
////////////////////////////////////////////////////////////////////////////////
// DragDropController, private:
-void DragDropController::OnImplicitAnimationsCompleted() {
+void DragDropController::OnLayerAnimationEnded(
+ const ui::LayerAnimationSequence* sequence) {
DCHECK(drag_image_.get());
drag_image_.reset();
}
+void DragDropController::OnLayerAnimationAborted(
+ const ui::LayerAnimationSequence* sequence) {
+ DCHECK(drag_image_.get());
+ drag_image_.reset();
+}
+
void DragDropController::StartCanceledAnimation() {
aura::Window* window = drag_image_->GetWidget()->GetNativeView();
ui::LayerAnimator* animator = window->layer()->GetAnimator();
animator->set_preemption_strategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
-
- // Stop waiting for any as yet unfinished implicit animations.
- StopObservingImplicitAnimations();
-
+ animator->AddObserver(this);
ui::ScopedLayerAnimationSettings animation_setter(animator);
animation_setter.SetTransitionDuration(kDragDropAnimationDuration);
- animation_setter.AddObserver(this);
window->SetBounds(gfx::Rect(drag_start_location_, window->bounds().size()));
}
« no previous file with comments | « ash/drag_drop/drag_drop_controller.h ('k') | ash/test/aura_shell_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698