| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/frame/caption_buttons/frame_caption_button.h" | 5 #include "ash/common/frame/caption_buttons/frame_caption_button.h" |
| 6 | 6 |
| 7 #include "ui/gfx/animation/slide_animation.h" | 7 #include "ui/gfx/animation/slide_animation.h" |
| 8 #include "ui/gfx/animation/throb_animation.h" | 8 #include "ui/gfx/animation/throb_animation.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/gfx/color_palette.h" | 10 #include "ui/gfx/color_palette.h" |
| 11 #include "ui/gfx/paint_vector_icon.h" | 11 #include "ui/gfx/paint_vector_icon.h" |
| 12 #include "ui/gfx/vector_icons_public.h" | |
| 13 | 12 |
| 14 namespace ash { | 13 namespace ash { |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 // The duration of the crossfade animation when swapping the button's images. | 17 // The duration of the crossfade animation when swapping the button's images. |
| 19 const int kSwapImagesAnimationDurationMs = 200; | 18 const int kSwapImagesAnimationDurationMs = 200; |
| 20 | 19 |
| 21 // The duration of the fade out animation of the old icon during a crossfade | 20 // The duration of the fade out animation of the old icon during a crossfade |
| 22 // animation as a ratio of |kSwapImagesAnimationDurationMs|. | 21 // animation as a ratio of |kSwapImagesAnimationDurationMs|. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 alpha *= inactive_alpha; | 181 alpha *= inactive_alpha; |
| 183 } | 182 } |
| 184 | 183 |
| 185 cc::PaintFlags flags; | 184 cc::PaintFlags flags; |
| 186 flags.setAlpha(alpha); | 185 flags.setAlpha(alpha); |
| 187 canvas->DrawImageInt(to_center, (width() - to_center.width()) / 2, | 186 canvas->DrawImageInt(to_center, (width() - to_center.width()) / 2, |
| 188 (height() - to_center.height()) / 2, flags); | 187 (height() - to_center.height()) / 2, flags); |
| 189 } | 188 } |
| 190 | 189 |
| 191 } // namespace ash | 190 } // namespace ash |
| OLD | NEW |