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

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 9222018: reland -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Gardening 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
Index: ash/drag_drop/drag_drop_controller.cc
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 7bc9025811976071dd3091b610be4a1aeeb968c4..078c535ebbe159a55d74305d7fc90ff3bd90bc2f 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -28,7 +28,7 @@ namespace {
const gfx::Point kDragDropWidgetOffset(0, 0);
const base::TimeDelta kDragDropAnimationDuration =
base::TimeDelta::FromMilliseconds(250);
-}
+} // namespace
////////////////////////////////////////////////////////////////////////////////
// DragDropController, public:
@@ -48,11 +48,8 @@ DragDropController::DragDropController()
DragDropController::~DragDropController() {
Shell::GetInstance()->RemoveRootWindowEventFilter(this);
Cleanup();
- if (drag_image_.get()) {
- aura::Window* window = drag_image_->GetWidget()->GetNativeView();
- window->layer()->GetAnimator()->RemoveObserver(this);
+ if (drag_image_.get())
drag_image_.reset();
- }
}
int DragDropController::StartDragAndDrop(const ui::OSExchangeData& data,
@@ -207,14 +204,7 @@ ui::GestureStatus DragDropController::PreHandleGestureEvent(
////////////////////////////////////////////////////////////////////////////////
// DragDropController, private:
-void DragDropController::OnLayerAnimationEnded(
- const ui::LayerAnimationSequence* sequence) {
- DCHECK(drag_image_.get());
- drag_image_.reset();
-}
-
-void DragDropController::OnLayerAnimationAborted(
- const ui::LayerAnimationSequence* sequence) {
+void DragDropController::OnImplicitAnimationsCompleted() OVERRIDE {
DCHECK(drag_image_.get());
drag_image_.reset();
}
@@ -224,9 +214,14 @@ void DragDropController::StartCanceledAnimation() {
ui::LayerAnimator* animator = window->layer()->GetAnimator();
animator->set_preemption_strategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
- animator->AddObserver(this);
+
+ // Stop waiting for any as yet unfinished implicit animations.
+ SetActive(false);
+ animator->RemoveObserver(this);
+
ui::ScopedLayerAnimationSettings animation_setter(animator);
animation_setter.SetTransitionDuration(kDragDropAnimationDuration);
+ animation_setter.AddObserver(this);
window->SetBounds(gfx::Rect(drag_start_location_, window->bounds().size()));
}

Powered by Google App Engine
This is Rietveld 408576698