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

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
Index: ash/shelf/shelf_view.cc
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index b5f5e72244a80a858fdcf1a0e33870982dde8a52..96234f1f73a2f40f807589fca52a0e9cbd388cfa 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -442,7 +442,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();
}
@@ -518,10 +518,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";
@@ -539,7 +542,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;
}
@@ -1762,8 +1765,9 @@ void ShelfView::ButtonPressed(views::Button* sender,
performed_action);
if (performed_action == ShelfItemDelegate::kNewWindowCreated ||
- !ShowListMenuForView(model_->items()[last_pressed_index_], sender,
- event, ink_drop)) {
+ (performed_action != ShelfItemDelegate::kAppListMenuShown &&
bruthig 2016/06/17 17:58:45 A doc saying the AppListButton handles the ink dro
mohsen 2016/06/18 06:25:15 Added a comment.
+ !ShowListMenuForView(model_->items()[last_pressed_index_], sender,
+ event, ink_drop))) {
ink_drop->AnimateToState(views::InkDropState::ACTION_TRIGGERED);
}
}

Powered by Google App Engine
This is Rietveld 408576698