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

Unified Diff: ash/shelf/shelf_button.h

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.cc ('k') | ash/shelf/shelf_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_button.h
diff --git a/ash/shelf/shelf_button.h b/ash/shelf/shelf_button.h
index 4a84a61a532d502bb5d7a60e0047ef4beea274a6..9295f78e64e9112134f4e6bb2da93283baf0350a 100644
--- a/ash/shelf/shelf_button.h
+++ b/ash/shelf/shelf_button.h
@@ -12,6 +12,7 @@
#include "ui/views/controls/image_view.h"
namespace ash {
+class InkDropButtonListener;
class ShelfView;
// Button used for items on the launcher, except for the AppList.
@@ -37,7 +38,7 @@ class ASH_EXPORT ShelfButton : public views::CustomButton {
STATE_HIDDEN = 1 << 5,
};
- explicit ShelfButton(ShelfView* shelf_view);
+ ShelfButton(InkDropButtonListener* listener, ShelfView* shelf_view);
~ShelfButton() override;
// Sets the image to display for this entry.
@@ -54,6 +55,9 @@ class ASH_EXPORT ShelfButton : public views::CustomButton {
// Returns the bounds of the icon.
gfx::Rect GetIconBounds() const;
+ // Called when user started dragging the shelf button.
+ void OnDragStarted();
+
// Overrides to views::CustomButton:
void ShowContextMenu(const gfx::Point& p,
ui::MenuSourceType source_type) override;
@@ -77,6 +81,12 @@ class ASH_EXPORT ShelfButton : public views::CustomButton {
// ui::EventHandler overrides:
void OnGestureEvent(ui::GestureEvent* event) override;
+ // views::CustomButton overrides:
+ std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
+ bool ShouldEnterPushedState(const ui::Event& event) override;
+ bool ShouldShowInkDropHighlight() const override;
+ void NotifyClick(const ui::Event& event) override;
+
// Sets the icon image with a shadow.
void SetShadowedImage(const gfx::ImageSkia& bitmap);
@@ -90,6 +100,8 @@ class ASH_EXPORT ShelfButton : public views::CustomButton {
// Updates the status bar (bitmap, orientation, visibility).
void UpdateBar();
+ InkDropButtonListener* listener_;
+
// The shelf view hosting this button.
ShelfView* shelf_view_;
« no previous file with comments | « ash/shelf/overflow_button.cc ('k') | ash/shelf/shelf_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698