| Index: ash/shelf/overflow_button.cc
|
| diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc
|
| index f80c903a845df1f47389774fec603ff4cc652433..6599c844b02d0e1cad88c212226004e8c9dd7fa3 100644
|
| --- a/ash/shelf/overflow_button.cc
|
| +++ b/ash/shelf/overflow_button.cc
|
| @@ -7,6 +7,7 @@
|
| #include "ash/ash_switches.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"
|
| @@ -35,8 +36,8 @@ const int kBackgroundOffset = (48 - kButtonHoverSize) / 2;
|
|
|
| } // namesapce
|
|
|
| -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();
|
|
|
| @@ -55,7 +56,7 @@ void OverflowButton::PaintBackground(gfx::Canvas* canvas, int alpha) {
|
| gfx::Rect rect(0, 0, kButtonHoverSize, kButtonHoverSize);
|
|
|
| // Nudge the background a little to line up right.
|
| - if (shelf_->IsHorizontalAlignment()) {
|
| + if (shelf_view_->shelf()->IsHorizontalAlignment()) {
|
| rect.set_origin(gfx::Point(
|
| bounds.x() + ((bounds.width() - kButtonHoverSize) / 2) - 1,
|
| bounds.y() + kBackgroundOffset - 1));
|
| @@ -83,16 +84,16 @@ void OverflowButton::OnPaint(gfx::Canvas* canvas) {
|
| gfx::Rect bounds(GetContentsBounds());
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| int background_image_id = 0;
|
| - if (shelf_->IsShowingOverflowBubble())
|
| + if (shelf_view_->shelf()->IsShowingOverflowBubble())
|
| background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED;
|
| - else if (shelf_->shelf_widget()->GetDimsShelf())
|
| + else if (shelf_view_->shelf()->shelf_widget()->GetDimsShelf())
|
| background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK;
|
| else
|
| background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL;
|
|
|
| const gfx::ImageSkia* background =
|
| rb.GetImageNamed(background_image_id).ToImageSkia();
|
| - ShelfAlignment alignment = shelf_->alignment();
|
| + ShelfAlignment alignment = shelf_view_->shelf()->alignment();
|
| if (alignment == SHELF_ALIGNMENT_LEFT) {
|
| bounds = gfx::Rect(
|
| bounds.right() - background->width() -
|
| @@ -142,4 +143,9 @@ void OverflowButton::OnPaint(gfx::Canvas* canvas) {
|
| bounds.y() + ((bounds.height() - image->height()) / 2));
|
| }
|
|
|
| +void OverflowButton::NotifyClick(const ui::Event& event) {
|
| + CustomButton::NotifyClick(event);
|
| + shelf_view_->ButtonPressed(this, event, ink_drop());
|
| +}
|
| +
|
| } // namespace ash
|
|
|