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

Unified Diff: ash/shelf/overflow_button.cc

Issue 2033553003: Add MD ink drop ripple to shelf app items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed DLL export issue Created 4 years, 6 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/shelf/overflow_button.cc
diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc
index 41e1317468dcf01e7ab3cfd4d3a78abb90ec164c..b1e361ea2cc081f2086e67cd150588a11df0e141 100644
--- a/ash/shelf/overflow_button.cc
+++ b/ash/shelf/overflow_button.cc
@@ -8,6 +8,7 @@
#include "ash/ash_switches.h"
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/shelf_constants.h"
+#include "ash/shelf/ink_drop_button_listener.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
@@ -29,8 +30,11 @@
namespace ash {
-OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf)
- : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) {
+OverflowButton::OverflowButton(InkDropButtonListener* listener, Shelf* shelf)
+ : CustomButton(nullptr),
+ bottom_image_(nullptr),
+ listener_(listener),
+ shelf_(shelf) {
if (MaterialDesignController::IsShelfMaterial()) {
bottom_image_md_ =
CreateVectorIcon(gfx::VectorIconId::SHELF_OVERFLOW, kShelfIconColor);
@@ -56,6 +60,12 @@ void OverflowButton::OnPaint(gfx::Canvas* canvas) {
PaintForeground(canvas, bounds);
}
+void OverflowButton::NotifyClick(const ui::Event& event) {
+ CustomButton::NotifyClick(event);
+ if (listener_)
+ listener_->ButtonPressed(this, event, ink_drop());
+}
+
void OverflowButton::PaintBackground(gfx::Canvas* canvas,
const gfx::Rect& bounds) {
if (MaterialDesignController::IsShelfMaterial()) {
@@ -91,7 +101,7 @@ void OverflowButton::PaintForeground(gfx::Canvas* canvas,
const gfx::Rect& bounds) {
const gfx::ImageSkia* image = nullptr;
- switch(shelf_->alignment()) {
+ switch (shelf_->alignment()) {
case SHELF_ALIGNMENT_LEFT:
if (left_image_.isNull()) {
left_image_ = gfx::ImageSkiaOperations::CreateRotatedImage(

Powered by Google App Engine
This is Rietveld 408576698