OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/launcher/tabbed_launcher_button.h" | 5 #include "ash/launcher/tabbed_launcher_button.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/launcher/launcher_button_host.h" | 9 #include "ash/launcher/launcher_button_host.h" |
10 #include "ash/launcher/launcher_types.h" | 10 #include "ash/launcher/launcher_types.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 void TabbedLauncherButton::IconView::SetTabImage(const gfx::ImageSkia& image) { | 63 void TabbedLauncherButton::IconView::SetTabImage(const gfx::ImageSkia& image) { |
64 if (image.isNull()) { | 64 if (image.isNull()) { |
65 if (!image_.isNull()) { | 65 if (!image_.isNull()) { |
66 // Pause for 500ms, then ease out for 200ms. | 66 // Pause for 500ms, then ease out for 200ms. |
67 ui::MultiAnimation::Parts animation_parts; | 67 ui::MultiAnimation::Parts animation_parts; |
68 animation_parts.push_back(ui::MultiAnimation::Part(500, ui::Tween::ZERO)); | 68 animation_parts.push_back(ui::MultiAnimation::Part(500, ui::Tween::ZERO)); |
69 animation_parts.push_back( | 69 animation_parts.push_back( |
70 ui::MultiAnimation::Part(200, ui::Tween::EASE_OUT)); | 70 ui::MultiAnimation::Part(200, ui::Tween::EASE_OUT)); |
71 animation_.reset(new ui::MultiAnimation( | 71 animation_.reset(new ui::MultiAnimation(animation_parts)); |
72 animation_parts, | |
73 ui::MultiAnimation::GetDefaultTimerInterval())); | |
74 animation_->set_continuous(false); | 72 animation_->set_continuous(false); |
75 animation_->set_delegate(this); | 73 animation_->set_delegate(this); |
76 animation_->Start(); | 74 animation_->Start(); |
77 animating_image_ = image_; | 75 animating_image_ = image_; |
78 image_ = image; | 76 image_ = image; |
79 } | 77 } |
80 } else { | 78 } else { |
81 animation_.reset(); | 79 animation_.reset(); |
82 SchedulePaint(); | 80 SchedulePaint(); |
83 image_ = image; | 81 image_ = image; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 139 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
142 state->name = host()->GetAccessibleName(this); | 140 state->name = host()->GetAccessibleName(this); |
143 } | 141 } |
144 | 142 |
145 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { | 143 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { |
146 return new IconView(this); | 144 return new IconView(this); |
147 } | 145 } |
148 | 146 |
149 } // namespace internal | 147 } // namespace internal |
150 } // namespace ash | 148 } // namespace ash |
OLD | NEW |