| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 AnimationProgressed(animation); | 50 AnimationProgressed(animation); |
| 51 animating_image_ = SkBitmap(); | 51 animating_image_ = SkBitmap(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void TabbedLauncherButton::IconView::AnimationProgressed( | 54 void TabbedLauncherButton::IconView::AnimationProgressed( |
| 55 const ui::Animation* animation) { | 55 const ui::Animation* animation) { |
| 56 if (animation_->current_part_index() == 1) | 56 if (animation_->current_part_index() == 1) |
| 57 SchedulePaint(); | 57 SchedulePaint(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void TabbedLauncherButton::IconView::SetTabImage(const SkBitmap& image) { | 60 void TabbedLauncherButton::IconView::SetTabImage(const gfx::ImageSkia& image) { |
| 61 if (image.empty()) { | 61 if (image.empty()) { |
| 62 if (!image_.empty()) { | 62 if (!image_.empty()) { |
| 63 // Pause for 500ms, then ease out for 200ms. | 63 // Pause for 500ms, then ease out for 200ms. |
| 64 ui::MultiAnimation::Parts animation_parts; | 64 ui::MultiAnimation::Parts animation_parts; |
| 65 animation_parts.push_back(ui::MultiAnimation::Part(500, ui::Tween::ZERO)); | 65 animation_parts.push_back(ui::MultiAnimation::Part(500, ui::Tween::ZERO)); |
| 66 animation_parts.push_back( | 66 animation_parts.push_back( |
| 67 ui::MultiAnimation::Part(200, ui::Tween::EASE_OUT)); | 67 ui::MultiAnimation::Part(200, ui::Tween::EASE_OUT)); |
| 68 animation_.reset(new ui::MultiAnimation(animation_parts)); | 68 animation_.reset(new ui::MultiAnimation(animation_parts)); |
| 69 animation_->set_continuous(false); | 69 animation_->set_continuous(false); |
| 70 animation_->set_delegate(this); | 70 animation_->set_delegate(this); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 LauncherButtonHost* host, | 120 LauncherButtonHost* host, |
| 121 IncognitoState is_incognito) | 121 IncognitoState is_incognito) |
| 122 : LauncherButton(listener, host), | 122 : LauncherButton(listener, host), |
| 123 is_incognito_(is_incognito) { | 123 is_incognito_(is_incognito) { |
| 124 set_accessibility_focusable(true); | 124 set_accessibility_focusable(true); |
| 125 } | 125 } |
| 126 | 126 |
| 127 TabbedLauncherButton::~TabbedLauncherButton() { | 127 TabbedLauncherButton::~TabbedLauncherButton() { |
| 128 } | 128 } |
| 129 | 129 |
| 130 void TabbedLauncherButton::SetTabImage(const SkBitmap& image) { | 130 void TabbedLauncherButton::SetTabImage(const gfx::ImageSkia& image) { |
| 131 tabbed_icon_view()->SetTabImage(image); | 131 tabbed_icon_view()->SetTabImage(image); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void TabbedLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { | 134 void TabbedLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { |
| 135 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 135 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 136 state->name = host()->GetAccessibleName(this); | 136 state->name = host()->GetAccessibleName(this); |
| 137 } | 137 } |
| 138 | 138 |
| 139 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { | 139 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { |
| 140 return new IconView(this); | 140 return new IconView(this); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace internal | 143 } // namespace internal |
| 144 } // namespace ash | 144 } // namespace ash |
| OLD | NEW |