| Index: ash/common/shelf/app_list_button.cc
|
| diff --git a/ash/common/shelf/app_list_button.cc b/ash/common/shelf/app_list_button.cc
|
| index 7781625be42f4dcf1ec8efdc890ac578b2477da5..e31acdf85f0f02fcbe47d827aef833cfd177de0e 100644
|
| --- a/ash/common/shelf/app_list_button.cc
|
| +++ b/ash/common/shelf/app_list_button.cc
|
| @@ -35,6 +35,7 @@ AppListButton::AppListButton(InkDropButtonListener* listener,
|
| WmShelf* wm_shelf)
|
| : views::ImageButton(nullptr),
|
| draw_background_as_active_(false),
|
| + background_alpha_(0),
|
| listener_(listener),
|
| shelf_view_(shelf_view),
|
| wm_shelf_(wm_shelf) {
|
| @@ -73,6 +74,11 @@ void AppListButton::OnAppListDismissed() {
|
| SchedulePaint();
|
| }
|
|
|
| +void AppListButton::SetBackgroundAlpha(int alpha) {
|
| + background_alpha_ = alpha;
|
| + SchedulePaint();
|
| +}
|
| +
|
| bool AppListButton::OnMousePressed(const ui::MouseEvent& event) {
|
| ImageButton::OnMousePressed(event);
|
| shelf_view_->PointerPressedOnButton(this, ShelfView::MOUSE, event);
|
| @@ -157,22 +163,16 @@ void AppListButton::OnPaint(gfx::Canvas* canvas) {
|
| }
|
|
|
| void AppListButton::PaintBackgroundMD(gfx::Canvas* canvas) {
|
| - SkPaint background_paint;
|
| - background_paint.setColor(SK_ColorTRANSPARENT);
|
| - background_paint.setFlags(SkPaint::kAntiAlias_Flag);
|
| - background_paint.setStyle(SkPaint::kFill_Style);
|
| -
|
| - if (wm_shelf_->GetBackgroundType() ==
|
| - ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT) {
|
| - background_paint.setColor(
|
| - SkColorSetA(kShelfBaseColor, GetShelfConstant(SHELF_BACKGROUND_ALPHA)));
|
| - }
|
| -
|
| // Paint the circular background of AppList button.
|
| gfx::Point circle_center = GetContentsBounds().CenterPoint();
|
| if (!IsHorizontalAlignment(wm_shelf_->GetAlignment()))
|
| circle_center = gfx::Point(circle_center.y(), circle_center.x());
|
|
|
| + SkPaint background_paint;
|
| + background_paint.setColor(SkColorSetA(kShelfBaseColor, background_alpha_));
|
| + background_paint.setFlags(SkPaint::kAntiAlias_Flag);
|
| + background_paint.setStyle(SkPaint::kFill_Style);
|
| +
|
| canvas->DrawCircle(circle_center, kAppListButtonRadius, background_paint);
|
| }
|
|
|
|
|