| Index: ash/common/shelf/overflow_button.cc
|
| diff --git a/ash/common/shelf/overflow_button.cc b/ash/common/shelf/overflow_button.cc
|
| index 6a8585750c7b971d02bd366fab49fbebf2915ea9..0be658a5b879aab8ff6fc184e35777ad7cfcfb6d 100644
|
| --- a/ash/common/shelf/overflow_button.cc
|
| +++ b/ash/common/shelf/overflow_button.cc
|
| @@ -23,6 +23,7 @@
|
| #include "ui/gfx/skia_util.h"
|
| #include "ui/gfx/transform.h"
|
| #include "ui/gfx/vector_icons_public.h"
|
| +#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
|
|
|
| namespace ash {
|
|
|
| @@ -33,6 +34,10 @@ OverflowButton::OverflowButton(InkDropButtonListener* listener,
|
| listener_(listener),
|
| wm_shelf_(wm_shelf) {
|
| if (MaterialDesignController::IsShelfMaterial()) {
|
| + SetInkDropMode(InkDropMode::ON);
|
| + set_ink_drop_base_color(kShelfInkDropBaseColor);
|
| + set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity);
|
| + set_hide_ink_drop_when_showing_context_menu(false);
|
| bottom_image_md_ =
|
| CreateVectorIcon(gfx::VectorIconId::SHELF_OVERFLOW, kShelfIconColor);
|
| bottom_image_ = &bottom_image_md_;
|
| @@ -51,12 +56,42 @@ void OverflowButton::OnShelfAlignmentChanged() {
|
| SchedulePaint();
|
| }
|
|
|
| +void OverflowButton::OnOverflowBubbleShown() {
|
| + AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr);
|
| + if (!ash::MaterialDesignController::IsShelfMaterial())
|
| + SchedulePaint();
|
| +}
|
| +
|
| +void OverflowButton::OnOverflowBubbleHidden() {
|
| + AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr);
|
| + if (!ash::MaterialDesignController::IsShelfMaterial())
|
| + SchedulePaint();
|
| +}
|
| +
|
| void OverflowButton::OnPaint(gfx::Canvas* canvas) {
|
| gfx::Rect bounds = CalculateButtonBounds();
|
| PaintBackground(canvas, bounds);
|
| PaintForeground(canvas, bounds);
|
| }
|
|
|
| +std::unique_ptr<views::InkDropRipple> OverflowButton::CreateInkDropRipple()
|
| + const {
|
| + return base::WrapUnique(new views::FloodFillInkDropRipple(
|
| + CalculateButtonBounds(), GetInkDropCenterBasedOnLastEvent(),
|
| + GetInkDropBaseColor(), ink_drop_visible_opacity()));
|
| +}
|
| +
|
| +bool OverflowButton::ShouldEnterPushedState(const ui::Event& event) {
|
| + if (wm_shelf_->IsShowingOverflowBubble())
|
| + return false;
|
| +
|
| + return CustomButton::ShouldEnterPushedState(event);
|
| +}
|
| +
|
| +bool OverflowButton::ShouldShowInkDropHighlight() const {
|
| + return false;
|
| +}
|
| +
|
| void OverflowButton::NotifyClick(const ui::Event& event) {
|
| CustomButton::NotifyClick(event);
|
| if (listener_)
|
| @@ -80,14 +115,6 @@ void OverflowButton::PaintBackground(gfx::Canvas* canvas,
|
| background_paint.setColor(background_color);
|
| canvas->DrawRoundRect(bounds, kOverflowButtonCornerRadius,
|
| background_paint);
|
| -
|
| - if (wm_shelf_->IsShowingOverflowBubble()) {
|
| - SkPaint highlight_paint;
|
| - highlight_paint.setFlags(SkPaint::kAntiAlias_Flag);
|
| - highlight_paint.setColor(kShelfButtonActivatedHighlightColor);
|
| - canvas->DrawRoundRect(bounds, kOverflowButtonCornerRadius,
|
| - highlight_paint);
|
| - }
|
| } else {
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| const gfx::ImageSkia* background =
|
| @@ -125,7 +152,7 @@ void OverflowButton::PaintForeground(gfx::Canvas* canvas,
|
| bounds.y() + ((bounds.height() - image->height()) / 2));
|
| }
|
|
|
| -int OverflowButton::NonMaterialBackgroundImageId() {
|
| +int OverflowButton::NonMaterialBackgroundImageId() const {
|
| if (wm_shelf_->IsShowingOverflowBubble())
|
| return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED;
|
| else if (wm_shelf_->IsDimmed())
|
| @@ -133,7 +160,7 @@ int OverflowButton::NonMaterialBackgroundImageId() {
|
| return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL;
|
| }
|
|
|
| -gfx::Rect OverflowButton::CalculateButtonBounds() {
|
| +gfx::Rect OverflowButton::CalculateButtonBounds() const {
|
| ShelfAlignment alignment = wm_shelf_->GetAlignment();
|
| gfx::Rect bounds(GetContentsBounds());
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
|
|