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

Unified Diff: ui/aura/desktop.cc

Issue 8395046: Allows observers to be notified when layer animations complete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 9 years, 2 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: ui/aura/desktop.cc
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index 2c747d28beb72b28eb1182e205bcfd9f37ff51e2..77258c15f2d0b92051a5d16a60e6d23c5be02b35 100644
--- a/ui/aura/desktop.cc
+++ b/ui/aura/desktop.cc
@@ -305,8 +305,10 @@ bool Desktop::DispatchKeyEvent(KeyEvent* event) {
if (degrees != 0) {
layer()->GetAnimator()->set_preemption_strategy(
ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
- layer()->GetAnimator()->ScheduleAnimationElement(
- new ScreenRotation(degrees));
+ scoped_ptr<ui::LayerAnimationSequence> screen_rotation(
+ new ui::LayerAnimationSequence(new ScreenRotation(degrees)));
+ screen_rotation->AddObserver(this);
+ layer()->GetAnimator()->ScheduleAnimation(screen_rotation.release());
return true;
}
}
@@ -562,6 +564,14 @@ void Desktop::OnLayerAnimationEnded(
OnHostResized(host_->GetSize());
}
+void Desktop::OnLayerAnimationScheduled(
+ const ui::LayerAnimationSequence* animation) {
+}
+
+void Desktop::OnLayerAnimationAborted(
+ const ui::LayerAnimationSequence* animation) {
+}
+
void Desktop::SetFocusedWindow(Window* focused_window) {
if (focused_window == focused_window_ ||
(focused_window && !focused_window->CanFocus())) {

Powered by Google App Engine
This is Rietveld 408576698