| 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/launcher_button.h" | 5 #include "ash/launcher/launcher_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/launcher/launcher_button_host.h" | 10 #include "ash/launcher/launcher_button_host.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 if (width > pref) { | 269 if (width > pref) { |
| 270 width = pref; | 270 width = pref; |
| 271 height = static_cast<int>(width / aspect_ratio); | 271 height = static_cast<int>(width / aspect_ratio); |
| 272 } | 272 } |
| 273 | 273 |
| 274 if (width == image.width() && height == image.height()) { | 274 if (width == image.width() && height == image.height()) { |
| 275 SetShadowedImage(image); | 275 SetShadowedImage(image); |
| 276 return; | 276 return; |
| 277 } | 277 } |
| 278 | 278 |
| 279 SetShadowedImage(gfx::ImageSkiaOperations::CreateResizedImage( | 279 SetShadowedImage(gfx::ImageSkiaOperations::CreateResizedImage(image, |
| 280 image, gfx::Size(width, height))); | 280 skia::ImageOperations::RESIZE_BEST, gfx::Size(width, height))); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void LauncherButton::AddState(State state) { | 283 void LauncherButton::AddState(State state) { |
| 284 if (!(state_ & state)) { | 284 if (!(state_ & state)) { |
| 285 if (ShouldHop(state) || !ShouldHop(state_)) { | 285 if (ShouldHop(state) || !ShouldHop(state_)) { |
| 286 ui::ScopedLayerAnimationSettings scoped_setter( | 286 ui::ScopedLayerAnimationSettings scoped_setter( |
| 287 icon_view_->layer()->GetAnimator()); | 287 icon_view_->layer()->GetAnimator()); |
| 288 scoped_setter.SetTransitionDuration( | 288 scoped_setter.SetTransitionDuration( |
| 289 base::TimeDelta::FromMilliseconds(kHopUpMS)); | 289 base::TimeDelta::FromMilliseconds(kHopUpMS)); |
| 290 state_ |= state; | 290 state_ |= state; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 bar_->SetVerticalAlignment(views::ImageView::CENTER); | 502 bar_->SetVerticalAlignment(views::ImageView::CENTER); |
| 503 break; | 503 break; |
| 504 } | 504 } |
| 505 | 505 |
| 506 Layout(); | 506 Layout(); |
| 507 SchedulePaint(); | 507 SchedulePaint(); |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace internal | 510 } // namespace internal |
| 511 } // namespace ash | 511 } // namespace ash |
| OLD | NEW |