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

Unified Diff: ash/shelf/shelf_view.cc

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Rebased 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/shelf_view.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view.cc
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index 3fe0ea29513795d139b4fd208aafbb6df67040d6..634bb69f9e63dae91008d783d18c1ff989195bab 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -438,7 +438,7 @@ void ShelfView::OnShelfAlignmentChanged() {
if (overflow_bubble_)
overflow_bubble_->Hide();
// For crbug.com/587931, because AppListButton layout logic is in OnPaint.
- views::View* app_list_button = GetAppListButtonView();
+ AppListButton* app_list_button = GetAppListButton();
if (app_list_button)
app_list_button->SchedulePaint();
}
@@ -512,10 +512,13 @@ bool ShelfView::IsShowingOverflowBubble() const {
return overflow_bubble_.get() && overflow_bubble_->IsShowing();
}
-views::View* ShelfView::GetAppListButtonView() const {
+AppListButton* ShelfView::GetAppListButton() const {
for (int i = 0; i < model_->item_count(); ++i) {
- if (model_->items()[i].type == TYPE_APP_LIST)
- return view_model_->view_at(i);
+ if (model_->items()[i].type == TYPE_APP_LIST) {
+ views::View* view = view_model_->view_at(i);
+ CHECK_EQ(AppListButton::kViewClassName, view->GetClassName());
+ return static_cast<AppListButton*>(view);
+ }
}
NOTREACHED() << "Applist button not found";
@@ -533,7 +536,7 @@ bool ShelfView::ShouldHideTooltip(const gfx::Point& cursor_location) const {
}
bool ShelfView::ShouldShowTooltipForView(const views::View* view) const {
- if (view == GetAppListButtonView() &&
+ if (view == GetAppListButton() &&
Shell::GetInstance()->GetAppListTargetVisibility()) {
return false;
}
@@ -1744,9 +1747,12 @@ void ShelfView::ButtonPressed(views::Button* sender,
shelf_button_pressed_metric_tracker_.ButtonPressed(event, sender,
performed_action);
+ // For the app list menu no TRIGGERED ink drop effect is needed and it
+ // handles its own ACTIVATED/DEACTIVATED states.
if (performed_action == ShelfItemDelegate::kNewWindowCreated ||
- !ShowListMenuForView(model_->items()[last_pressed_index_], sender,
- event, ink_drop)) {
+ (performed_action != ShelfItemDelegate::kAppListMenuShown &&
+ !ShowListMenuForView(model_->items()[last_pressed_index_], sender,
+ event, ink_drop))) {
ink_drop->AnimateToState(views::InkDropState::ACTION_TRIGGERED);
}
}
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698