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

Unified Diff: ash/shelf/shelf_view.h

Issue 772963002: Make the second click on the app shelf icon close the window-list bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address the code review comments. Created 6 years 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view.h
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h
index 7aac1deb419093682c696464d7071cecf58eb44a..037922e55b09f33bbc21ff9fbd33c57a39087aed 100644
--- a/ash/shelf/shelf_view.h
+++ b/ash/shelf/shelf_view.h
@@ -304,9 +304,10 @@ class ASH_EXPORT ShelfView : public views::View,
void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override;
void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override;
- // Returns false if the click which closed the previous menu is the click
- // which triggered this event.
- bool IsUsableEvent(const ui::Event& event);
+ // Returns true if the (press down) |event| is a repost event from an event
+ // which just closed the menu of a shelf item. If it occurs on the same shelf
+ // item, we should ignore the call.
+ bool IsRepostEvent(const ui::Event& event);
// Convenience accessor to model_->items().
const ShelfItem* ShelfItemForView(const views::View* view) const;
@@ -435,6 +436,15 @@ class ASH_EXPORT ShelfView : public views::View,
// True when ripped item from overflow bubble is entered into Shelf.
bool dragged_off_from_overflow_to_shelf_;
+ // True if the event is a repost event from a event which has just closed the
+ // menu of the same shelf item.
+ bool is_repost_event_;
+
+ // Record the index for the last pressed shelf item. This variable is used to
+ // check if a repost event occurs on the same shelf item as previous one. If
+ // so, the repost event should be ignored.
+ int last_pressed_index_;
+
DISALLOW_COPY_AND_ASSIGN(ShelfView);
};
« no previous file with comments | « no previous file | ash/shelf/shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698