| Index: ash/shelf/overflow_button.cc
|
| diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc
|
| index 3602ae1fcf76deaad4fdf8df504482f4b4135549..fdc94a766e8c9a9369753d18328c7fda79dfc27c 100644
|
| --- a/ash/shelf/overflow_button.cc
|
| +++ b/ash/shelf/overflow_button.cc
|
| @@ -9,6 +9,7 @@
|
| #include "ash/common/shelf/shelf_constants.h"
|
| #include "ash/shelf/shelf.h"
|
| #include "ash/shelf/shelf_layout_manager.h"
|
| +#include "ash/shelf/shelf_view.h"
|
| #include "ash/shelf/shelf_widget.h"
|
| #include "grit/ash_resources.h"
|
| #include "grit/ash_strings.h"
|
| @@ -26,8 +27,8 @@
|
|
|
| namespace ash {
|
|
|
| -OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf)
|
| - : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) {
|
| +OverflowButton::OverflowButton(ShelfView* shelf_view)
|
| + : CustomButton(nullptr), bottom_image_(nullptr), shelf_view_(shelf_view) {
|
| ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
|
| bottom_image_ = rb->GetImageNamed(IDR_ASH_SHELF_OVERFLOW).ToImageSkia();
|
|
|
| @@ -47,12 +48,17 @@ void OverflowButton::OnPaint(gfx::Canvas* canvas) {
|
| PaintForeground(canvas, bounds);
|
| }
|
|
|
| +void OverflowButton::NotifyClick(const ui::Event& event) {
|
| + CustomButton::NotifyClick(event);
|
| + shelf_view_->ButtonPressed(this, event, ink_drop());
|
| +}
|
| +
|
| void OverflowButton::PaintBackground(gfx::Canvas* canvas,
|
| const gfx::Rect& bounds) {
|
| if (MaterialDesignController::IsShelfMaterial()) {
|
| SkColor color = SK_ColorTRANSPARENT;
|
| - ShelfWidget* shelf_widget = shelf_->shelf_widget();
|
| - if (shelf_->IsShowingOverflowBubble()) {
|
| + ShelfWidget* shelf_widget = shelf_view_->shelf()->shelf_widget();
|
| + if (shelf_view_->shelf()->IsShowingOverflowBubble()) {
|
| // TODO(bruthig|mohsen): Use of this color is temporary. Draw the active
|
| // state using the material design ripple animation.
|
| color = SK_ColorBLUE;
|
| @@ -82,7 +88,7 @@ void OverflowButton::PaintForeground(gfx::Canvas* canvas,
|
| const gfx::Rect& bounds) {
|
| const gfx::ImageSkia* image = nullptr;
|
|
|
| - switch(shelf_->alignment()) {
|
| + switch (shelf_view_->shelf()->alignment()) {
|
| case SHELF_ALIGNMENT_LEFT:
|
| if (left_image_.isNull()) {
|
| left_image_ = gfx::ImageSkiaOperations::CreateRotatedImage(
|
| @@ -108,15 +114,15 @@ void OverflowButton::PaintForeground(gfx::Canvas* canvas,
|
| }
|
|
|
| int OverflowButton::NonMaterialBackgroundImageId() {
|
| - if (shelf_->IsShowingOverflowBubble())
|
| + if (shelf_view_->shelf()->IsShowingOverflowBubble())
|
| return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED;
|
| - else if (shelf_->shelf_widget()->GetDimsShelf())
|
| + else if (shelf_view_->shelf()->shelf_widget()->GetDimsShelf())
|
| return IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK;
|
| return IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL;
|
| }
|
|
|
| gfx::Rect OverflowButton::CalculateButtonBounds() {
|
| - ShelfAlignment alignment = shelf_->alignment();
|
| + ShelfAlignment alignment = shelf_view_->shelf()->alignment();
|
| gfx::Rect bounds(GetContentsBounds());
|
| if (!MaterialDesignController::IsShelfMaterial()) {
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
|
|