Chromium Code Reviews| Index: ui/keyboard/keyboard_controller.cc |
| diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc |
| index 5aa44bbbaf599bf7c431ec55456e8e7277092d80..f410b4c97373de94e8d3be972ae5733c95e76018 100644 |
| --- a/ui/keyboard/keyboard_controller.cc |
| +++ b/ui/keyboard/keyboard_controller.cc |
| @@ -124,6 +124,7 @@ class CallbackAnimationObserver : public ui::LayerAnimationObserver { |
| void OnLayerAnimationEnded(ui::LayerAnimationSequence* seq) override; |
| void OnLayerAnimationAborted(ui::LayerAnimationSequence* seq) override; |
| void OnLayerAnimationScheduled(ui::LayerAnimationSequence* seq) override {} |
| + bool RequiresNotificationWhenAnimatorDestroyed() const override; |
| ui::LayerAnimator* animator_; |
|
sadrul
2015/04/23 23:07:59
Should this be a scoped_refptr<> instead?
bshe
2015/04/24 14:24:37
Great suggestion! Done.
|
| base::Callback<void(void)> callback_; |
| @@ -137,7 +138,8 @@ CallbackAnimationObserver::CallbackAnimationObserver( |
| } |
| CallbackAnimationObserver::~CallbackAnimationObserver() { |
| - animator_->RemoveObserver(this); |
| + if (animator_) |
| + animator_->RemoveObserver(this); |
| } |
| void CallbackAnimationObserver::OnLayerAnimationEnded( |
| @@ -146,11 +148,18 @@ void CallbackAnimationObserver::OnLayerAnimationEnded( |
| return; |
| animator_->RemoveObserver(this); |
| callback_.Run(); |
| + animator_ = NULL; |
| } |
| void CallbackAnimationObserver::OnLayerAnimationAborted( |
| ui::LayerAnimationSequence* seq) { |
| animator_->RemoveObserver(this); |
| + animator_ = NULL; |
| +} |
| + |
| +bool CallbackAnimationObserver::RequiresNotificationWhenAnimatorDestroyed() |
| + const { |
| + return true; |
| } |
| class WindowBoundsChangeObserver : public aura::WindowObserver { |