OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_SHELF_SHELF_VIEW_H_ | 5 #ifndef ASH_SHELF_SHELF_VIEW_H_ |
6 #define ASH_SHELF_SHELF_VIEW_H_ | 6 #define ASH_SHELF_SHELF_VIEW_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 void ShowMenu(ui::MenuModel* menu_model, | 297 void ShowMenu(ui::MenuModel* menu_model, |
298 views::View* source, | 298 views::View* source, |
299 const gfx::Point& click_point, | 299 const gfx::Point& click_point, |
300 bool context_menu, | 300 bool context_menu, |
301 ui::MenuSourceType source_type); | 301 ui::MenuSourceType source_type); |
302 | 302 |
303 // Overridden from views::BoundsAnimatorObserver: | 303 // Overridden from views::BoundsAnimatorObserver: |
304 void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override; | 304 void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override; |
305 void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override; | 305 void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override; |
306 | 306 |
307 // Returns false if the click which closed the previous menu is the click | 307 // Returns true if the (press down) |event| is a repost event from an event |
308 // which triggered this event. | 308 // which just closed the menu of a shelf item. If it occurs on the same shelf |
309 bool IsUsableEvent(const ui::Event& event); | 309 // item, we should ignore the call. |
| 310 bool IsRepostEvent(const ui::Event& event); |
310 | 311 |
311 // Convenience accessor to model_->items(). | 312 // Convenience accessor to model_->items(). |
312 const ShelfItem* ShelfItemForView(const views::View* view) const; | 313 const ShelfItem* ShelfItemForView(const views::View* view) const; |
313 | 314 |
314 // Returns true if a tooltip should be shown for |view|. | 315 // Returns true if a tooltip should be shown for |view|. |
315 bool ShouldShowTooltipForView(const views::View* view) const; | 316 bool ShouldShowTooltipForView(const views::View* view) const; |
316 | 317 |
317 // Get the distance from the given |coordinate| to the closest point on this | 318 // Get the distance from the given |coordinate| to the closest point on this |
318 // launcher/shelf. | 319 // launcher/shelf. |
319 int CalculateShelfDistance(const gfx::Point& coordinate) const; | 320 int CalculateShelfDistance(const gfx::Point& coordinate) const; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 429 |
429 // True when this ShelfView is used for Overflow Bubble. | 430 // True when this ShelfView is used for Overflow Bubble. |
430 bool overflow_mode_; | 431 bool overflow_mode_; |
431 | 432 |
432 // Holds a pointer to main ShelfView when a ShelfView is in overflow mode. | 433 // Holds a pointer to main ShelfView when a ShelfView is in overflow mode. |
433 ShelfView* main_shelf_; | 434 ShelfView* main_shelf_; |
434 | 435 |
435 // True when ripped item from overflow bubble is entered into Shelf. | 436 // True when ripped item from overflow bubble is entered into Shelf. |
436 bool dragged_off_from_overflow_to_shelf_; | 437 bool dragged_off_from_overflow_to_shelf_; |
437 | 438 |
| 439 // True if the event is a repost event from a event which has just closed the |
| 440 // menu of the same shelf item. |
| 441 bool is_repost_event_; |
| 442 |
| 443 // Record the index for the last pressed shelf item. This variable is used to |
| 444 // check if a repost event occurs on the same shelf item as previous one. If |
| 445 // so, the repost event should be ignored. |
| 446 int last_pressed_index_; |
| 447 |
438 DISALLOW_COPY_AND_ASSIGN(ShelfView); | 448 DISALLOW_COPY_AND_ASSIGN(ShelfView); |
439 }; | 449 }; |
440 | 450 |
441 } // namespace ash | 451 } // namespace ash |
442 | 452 |
443 #endif // ASH_SHELF_SHELF_VIEW_H_ | 453 #endif // ASH_SHELF_SHELF_VIEW_H_ |
OLD | NEW |