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