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/shelf/shelf_button.h" | 5 #include "ash/common/shelf/shelf_button.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
10 #include "ash/common/shelf/ink_drop_button_listener.h" | 10 #include "ash/common/shelf/ink_drop_button_listener.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 SkAlpha alpha = ShelfButtonAnimation::GetInstance()->HasObserver(this) | 141 SkAlpha alpha = ShelfButtonAnimation::GetInstance()->HasObserver(this) |
142 ? ShelfButtonAnimation::GetInstance()->GetAlpha() | 142 ? ShelfButtonAnimation::GetInstance()->GetAlpha() |
143 : SK_AlphaOPAQUE; | 143 : SK_AlphaOPAQUE; |
144 canvas->SaveLayerAlpha(alpha); | 144 canvas->SaveLayerAlpha(alpha); |
145 } | 145 } |
146 | 146 |
147 DCHECK_EQ(width(), height()); | 147 DCHECK_EQ(width(), height()); |
148 DCHECK_EQ(kIndicatorRadiusDip, width() / 2); | 148 DCHECK_EQ(kIndicatorRadiusDip, width() / 2); |
149 cc::PaintFlags flags; | 149 cc::PaintFlags flags; |
150 flags.setColor(kIndicatorColor); | 150 flags.setColor(kIndicatorColor); |
151 flags.setFlags(cc::PaintFlags::kAntiAlias_Flag); | 151 flags.setAntiAlias(true); |
152 canvas->DrawCircle(gfx::Point(width() / 2, height() / 2), | 152 canvas->DrawCircle(gfx::Point(width() / 2, height() / 2), |
153 kIndicatorRadiusDip, flags); | 153 kIndicatorRadiusDip, flags); |
154 } | 154 } |
155 | 155 |
156 // ShelfButtonAnimation::Observer | 156 // ShelfButtonAnimation::Observer |
157 void AnimationProgressed() override { | 157 void AnimationProgressed() override { |
158 UpdateAnimating(); | 158 UpdateAnimating(); |
159 SchedulePaint(); | 159 SchedulePaint(); |
160 } | 160 } |
161 | 161 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 icon_view_->SetHorizontalAlignment(is_horizontal_shelf | 493 icon_view_->SetHorizontalAlignment(is_horizontal_shelf |
494 ? views::ImageView::CENTER | 494 ? views::ImageView::CENTER |
495 : views::ImageView::LEADING); | 495 : views::ImageView::LEADING); |
496 icon_view_->SetVerticalAlignment(is_horizontal_shelf | 496 icon_view_->SetVerticalAlignment(is_horizontal_shelf |
497 ? views::ImageView::LEADING | 497 ? views::ImageView::LEADING |
498 : views::ImageView::CENTER); | 498 : views::ImageView::CENTER); |
499 SchedulePaint(); | 499 SchedulePaint(); |
500 } | 500 } |
501 | 501 |
502 } // namespace ash | 502 } // namespace ash |
OLD | NEW |