| 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(animation_parts)); | 71 animation_.reset(new ui::MultiAnimation( |
| 72 animation_parts, |
| 73 ui::MultiAnimation::GetDefaultTimerInterval())); |
| 72 animation_->set_continuous(false); | 74 animation_->set_continuous(false); |
| 73 animation_->set_delegate(this); | 75 animation_->set_delegate(this); |
| 74 animation_->Start(); | 76 animation_->Start(); |
| 75 animating_image_ = image_; | 77 animating_image_ = image_; |
| 76 image_ = image; | 78 image_ = image; |
| 77 } | 79 } |
| 78 } else { | 80 } else { |
| 79 animation_.reset(); | 81 animation_.reset(); |
| 80 SchedulePaint(); | 82 SchedulePaint(); |
| 81 image_ = image; | 83 image_ = image; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 141 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 140 state->name = host()->GetAccessibleName(this); | 142 state->name = host()->GetAccessibleName(this); |
| 141 } | 143 } |
| 142 | 144 |
| 143 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { | 145 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { |
| 144 return new IconView(this); | 146 return new IconView(this); |
| 145 } | 147 } |
| 146 | 148 |
| 147 } // namespace internal | 149 } // namespace internal |
| 148 } // namespace ash | 150 } // namespace ash |
| OLD | NEW |