Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: ash/common/shelf/overflow_button.cc

Issue 2238903003: ash: Remove WmShelf::IsShowingOverflowBubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/shelf/overflow_button.cc
diff --git a/ash/common/shelf/overflow_button.cc b/ash/common/shelf/overflow_button.cc
index 03fe492f67312271089524edf48623c9ca9fa567..14120152315f03fb5299b40015d105d6b375d437 100644
--- a/ash/common/shelf/overflow_button.cc
+++ b/ash/common/shelf/overflow_button.cc
@@ -8,6 +8,7 @@
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/ink_drop_button_listener.h"
#include "ash/common/shelf/shelf_constants.h"
+#include "ash/common/shelf/shelf_view.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "grit/ash_resources.h"
@@ -26,13 +27,13 @@
namespace ash {
-OverflowButton::OverflowButton(InkDropButtonListener* listener,
- WmShelf* wm_shelf)
+OverflowButton::OverflowButton(ShelfView* shelf_view, WmShelf* wm_shelf)
: CustomButton(nullptr),
bottom_image_(nullptr),
- listener_(listener),
+ shelf_view_(shelf_view),
wm_shelf_(wm_shelf),
background_alpha_(0) {
+ DCHECK(shelf_view_);
if (MaterialDesignController::IsShelfMaterial()) {
bottom_image_md_ =
CreateVectorIcon(gfx::VectorIconId::SHELF_OVERFLOW, kShelfIconColor);
@@ -65,8 +66,7 @@ void OverflowButton::OnPaint(gfx::Canvas* canvas) {
void OverflowButton::NotifyClick(const ui::Event& event) {
CustomButton::NotifyClick(event);
- if (listener_)
- listener_->ButtonPressed(this, event, ink_drop());
+ shelf_view_->ButtonPressed(this, event, ink_drop());
}
void OverflowButton::PaintBackground(gfx::Canvas* canvas,
@@ -78,7 +78,7 @@ void OverflowButton::PaintBackground(gfx::Canvas* canvas,
canvas->DrawRoundRect(bounds, kOverflowButtonCornerRadius,
background_paint);
- if (wm_shelf_->IsShowingOverflowBubble()) {
+ if (shelf_view_->IsShowingOverflowBubble()) {
SkPaint highlight_paint;
highlight_paint.setFlags(SkPaint::kAntiAlias_Flag);
highlight_paint.setColor(kShelfButtonActivatedHighlightColor);
@@ -123,7 +123,7 @@ void OverflowButton::PaintForeground(gfx::Canvas* canvas,
}
int OverflowButton::NonMaterialBackgroundImageId() {
- if (wm_shelf_->IsShowingOverflowBubble())
+ if (shelf_view_->IsShowingOverflowBubble())
return IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED;
else if (wm_shelf_->IsDimmed())
return IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK;

Powered by Google App Engine
This is Rietveld 408576698