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

Side by Side Diff: ash/rotator/screen_rotation_animation.cc

Issue 2473523003: ash: Avoid a shutdown crash in ScreenRotationAnimation. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/rotator/screen_rotation_animation.h" 5 #include "ash/rotator/screen_rotation_animation.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "ui/compositor/layer.h" 8 #include "ui/compositor/layer.h"
9 #include "ui/compositor/layer_animation_delegate.h" 9 #include "ui/compositor/layer_animation_delegate.h"
10 #include "ui/gfx/animation/tween.h" 10 #include "ui/gfx/animation/tween.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 delegate->SetOpacityFromAnimation(gfx::Tween::FloatValueBetween( 51 delegate->SetOpacityFromAnimation(gfx::Tween::FloatValueBetween(
52 tweened, initial_opacity_, target_opacity_)); 52 tweened, initial_opacity_, target_opacity_));
53 return true; 53 return true;
54 } 54 }
55 55
56 void ScreenRotationAnimation::OnGetTarget(TargetValue* target) const { 56 void ScreenRotationAnimation::OnGetTarget(TargetValue* target) const {
57 target->transform = interpolated_transform_->Interpolate(1.0); 57 target->transform = interpolated_transform_->Interpolate(1.0);
58 } 58 }
59 59
60 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) { 60 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) {
61 // ui::Layer's d'tor passes its ui::LayerAnimator a null delegate before
62 // deleting it. This is then passed here: http://crbug.com/661313
63 if (!delegate)
64 return;
65
61 TargetValue target_value; 66 TargetValue target_value;
62 OnGetTarget(&target_value); 67 OnGetTarget(&target_value);
63 delegate->SetTransformFromAnimation(target_value.transform); 68 delegate->SetTransformFromAnimation(target_value.transform);
64 } 69 }
James Cook 2016/11/02 02:19:17 Can you also fix the bad "// Implementation of ui:
Daniel Erat 2016/11/02 14:04:05 Done.
65 70
66 } // namespace ash 71 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/rotator/screen_rotation_animation_unittest.cc » ('j') | ash/rotator/screen_rotation_animation_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698