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

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: . 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
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 2e43ea3813afe169f27e32a3c06039fb1dd64f76..255b0e2f13451e54b8ccdc49a7ccfb0fa3d05e2b 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:
@@ -47,11 +47,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,
@@ -206,14 +203,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() {
DCHECK(drag_image_.get());
drag_image_.reset();
}
@@ -223,9 +213,13 @@ 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.
+ StopObservingImplicitAnimations();
+
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