summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2015-12-29 11:37:38 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-29 19:38:39 +0000
commita1dbae6db9820855aa13dea0bba989793ed7d54a (patch)
tree4cd882da2a4c97f967d817bc0f06d329c83565cb /ash
parent1c5c483221fc47c35de8fe093a443f1fe4f92fcf (diff)
downloadchromium_src-a1dbae6db9820855aa13dea0bba989793ed7d54a.zip
chromium_src-a1dbae6db9820855aa13dea0bba989793ed7d54a.tar.gz
chromium_src-a1dbae6db9820855aa13dea0bba989793ed7d54a.tar.bz2
CustomButton cleanup: make protected members private, create accessors
Also delete some old file that's not in use. BUG=none TBR=erg@chromium.org Review URL: https://codereview.chromium.org/1534303002 Cr-Commit-Position: refs/heads/master@{#367093}
Diffstat (limited to 'ash')
-rw-r--r--ash/frame/caption_buttons/frame_caption_button.cc12
-rw-r--r--ash/shelf/overflow_button.cc6
2 files changed, 10 insertions, 8 deletions
diff --git a/ash/frame/caption_buttons/frame_caption_button.cc b/ash/frame/caption_buttons/frame_caption_button.cc
index 2b16643..99ac554 100644
--- a/ash/frame/caption_buttons/frame_caption_button.cc
+++ b/ash/frame/caption_buttons/frame_caption_button.cc
@@ -110,9 +110,11 @@ const char* FrameCaptionButton::GetClassName() const {
}
void FrameCaptionButton::OnPaint(gfx::Canvas* canvas) {
- if (hover_animation_->is_animating() || state() == STATE_HOVERED) {
- int hovered_background_alpha = hover_animation_->is_animating() ?
- hover_animation_->CurrentValueBetween(0, 255) : 255;
+ if (hover_animation().is_animating() || state() == STATE_HOVERED) {
+ int hovered_background_alpha =
+ hover_animation().is_animating()
+ ? hover_animation().CurrentValueBetween(0, 255)
+ : 255;
SkPaint paint;
paint.setAlpha(hovered_background_alpha);
canvas->DrawImageInt(hovered_background_image_, 0, 0, paint);
@@ -173,9 +175,9 @@ void FrameCaptionButton::PaintCentered(gfx::Canvas* canvas,
if (!paint_as_active_) {
// Paint icons as active when they are hovered over or pressed.
double inactive_alpha = kInactiveIconAlpha;
- if (hover_animation_->is_animating()) {
+ if (hover_animation().is_animating()) {
inactive_alpha =
- hover_animation_->CurrentValueBetween(inactive_alpha, 1.0f);
+ hover_animation().CurrentValueBetween(inactive_alpha, 1.0f);
} else if (state() == STATE_PRESSED || state() == STATE_HOVERED) {
inactive_alpha = 1.0f;
}
diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc
index 79b2bcd..66bc2b8 100644
--- a/ash/shelf/overflow_button.cc
+++ b/ash/shelf/overflow_button.cc
@@ -71,9 +71,9 @@ void OverflowButton::PaintBackground(gfx::Canvas* canvas, int alpha) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kFill_Style);
- paint.setColor(SkColorSetARGB(
- kButtonHoverAlpha * hover_animation_->GetCurrentValue(),
- 0, 0, 0));
+ paint.setColor(
+ SkColorSetA(SK_ColorBLACK,
+ hover_animation().CurrentValueBetween(0, kButtonHoverAlpha)));
const SkScalar radius = SkIntToScalar(kButtonCornerRadius);
SkPath path;