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

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: Removed TODO 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
« no previous file with comments | « ash/shelf/overflow_button.h ('k') | ash/shelf/shelf_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/overflow_button.cc
diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc
index 049ca2d232163c17ec1e8e7ddb0b7f1698285a27..4f1aa840ca73b695c2d178b37ae7dc13540f9888 100644
--- a/ash/shelf/overflow_button.cc
+++ b/ash/shelf/overflow_button.cc
@@ -9,6 +9,7 @@
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/system/tray/tray_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"
@@ -30,8 +31,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);
@@ -57,6 +61,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()) {
@@ -96,7 +106,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(
« no previous file with comments | « ash/shelf/overflow_button.h ('k') | ash/shelf/shelf_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698