| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/app_list_button.h" | 5 #include "ash/shelf/app_list_button.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/shelf/shelf_button_host.h" | 10 #include "ash/shelf/shelf_button_host.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 opacity_sequence->set_is_cyclic(true); | 61 opacity_sequence->set_is_cyclic(true); |
| 62 | 62 |
| 63 for (size_t i = 0; i < arraysize(kAnimationOpacity); ++i) { | 63 for (size_t i = 0; i < arraysize(kAnimationOpacity); ++i) { |
| 64 opacity_sequence->AddElement( | 64 opacity_sequence->AddElement( |
| 65 ui::LayerAnimationElement::CreateOpacityElement( | 65 ui::LayerAnimationElement::CreateOpacityElement( |
| 66 kAnimationOpacity[i], | 66 kAnimationOpacity[i], |
| 67 base::TimeDelta::FromMilliseconds(kAnimationDurationInMs))); | 67 base::TimeDelta::FromMilliseconds(kAnimationDurationInMs))); |
| 68 } | 68 } |
| 69 | 69 |
| 70 ui::LayerAnimationElement::AnimatableProperties opacity_properties; | |
| 71 opacity_properties.insert(ui::LayerAnimationElement::OPACITY); | |
| 72 opacity_sequence->AddElement( | 70 opacity_sequence->AddElement( |
| 73 ui::LayerAnimationElement::CreatePauseElement( | 71 ui::LayerAnimationElement::CreatePauseElement( |
| 74 opacity_properties, | 72 ui::LayerAnimationElement::OPACITY, |
| 75 base::TimeDelta::FromMilliseconds(kAnimationDurationInMs))); | 73 base::TimeDelta::FromMilliseconds(kAnimationDurationInMs))); |
| 76 | 74 |
| 77 // LayerAnimator takes ownership of the sequences. | 75 // LayerAnimator takes ownership of the sequences. |
| 78 layer()->GetAnimator()->ScheduleAnimation(opacity_sequence.release()); | 76 layer()->GetAnimator()->ScheduleAnimation(opacity_sequence.release()); |
| 79 } | 77 } |
| 80 | 78 |
| 81 void AppListButton::StopLoadingAnimation() { | 79 void AppListButton::StopLoadingAnimation() { |
| 82 layer()->GetAnimator()->StopAnimating(); | 80 layer()->GetAnimator()->StopAnimating(); |
| 83 | 81 |
| 84 ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator()); | 82 ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 host_->MouseExitedButton(this); | 123 host_->MouseExitedButton(this); |
| 126 } | 124 } |
| 127 | 125 |
| 128 void AppListButton::GetAccessibleState(ui::AccessibleViewState* state) { | 126 void AppListButton::GetAccessibleState(ui::AccessibleViewState* state) { |
| 129 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 127 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 130 state->name = host_->GetAccessibleName(this); | 128 state->name = host_->GetAccessibleName(this); |
| 131 } | 129 } |
| 132 | 130 |
| 133 } // namespace internal | 131 } // namespace internal |
| 134 } // namespace ash | 132 } // namespace ash |
| OLD | NEW |