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

Unified Diff: ash/common/shelf/shelf_view.cc

Issue 2807473003: Shelf: Hide overflow bubble when app launched from overflow. (Closed)
Patch Set: Fixed patch set 3 errors. Created 3 years, 8 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 | « no previous file | 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/common/shelf/shelf_view.cc
diff --git a/ash/common/shelf/shelf_view.cc b/ash/common/shelf/shelf_view.cc
index d99b9e76fdbea9a0df593b57f7a6eec0da50f799..29cb9706253390f3e5690d54dc55007e17384106 100644
--- a/ash/common/shelf/shelf_view.cc
+++ b/ash/common/shelf/shelf_view.cc
@@ -438,6 +438,13 @@ void ShelfView::ButtonPressed(views::Button* sender,
if (!ShouldEventActivateButton(sender, event))
return;
+ // If this is the overflow shelf, |main_shelf_| will not be null. When an item
+ // is pressed on the overflow shelf, we want to hide the overflow bubble,
+ // which is associated with the main shelf. Button presses on the main shelf
+ // cause the overflow bubble to close itself via PointerWatcher functionality.
+ if (main_shelf_ && main_shelf_->IsShowingOverflowBubble())
+ main_shelf_->ToggleOverflowBubble();
+
// Record the index for the last pressed shelf item.
last_pressed_index_ = view_model_->GetIndexOfView(sender);
DCHECK_LT(-1, last_pressed_index_);
« no previous file with comments | « no previous file | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698