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

Unified Diff: ash/shelf/app_list_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/app_list_button.cc
diff --git a/ash/shelf/app_list_button.cc b/ash/shelf/app_list_button.cc
index 51a1a281f5b4b18d212aef46182e831ba46c299a..290994a906831b301e6573791119610e7fbe46ae 100644
--- a/ash/shelf/app_list_button.cc
+++ b/ash/shelf/app_list_button.cc
@@ -7,6 +7,7 @@
#include "ash/ash_constants.h"
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/shelf_item_types.h"
+#include "ash/shelf/ink_drop_button_listener.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shelf/shelf_widget.h"
@@ -26,9 +27,11 @@
namespace ash {
-AppListButton::AppListButton(ShelfView* shelf_view)
- : views::ImageButton(shelf_view),
+AppListButton::AppListButton(InkDropButtonListener* listener,
+ ShelfView* shelf_view)
+ : views::ImageButton(nullptr),
draw_background_as_active_(false),
+ listener_(listener),
shelf_view_(shelf_view) {
SetAccessibleName(
app_list::switches::IsExperimentalAppListEnabled()
@@ -165,6 +168,12 @@ void AppListButton::GetAccessibleState(ui::AXViewState* state) {
state->name = shelf_view_->GetTitleForView(this);
}
+void AppListButton::NotifyClick(const ui::Event& event) {
+ ImageButton::NotifyClick(event);
+ if (listener_)
+ listener_->ButtonPressed(this, event, ink_drop());
+}
+
void AppListButton::SetDrawBackgroundAsActive(
bool draw_background_as_active) {
if (draw_background_as_active_ == draw_background_as_active)

Powered by Google App Engine
This is Rietveld 408576698