| 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_COMMON_SHELF_SHELF_VIEW_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_VIEW_H_ |
| 6 #define ASH_COMMON_SHELF_SHELF_VIEW_H_ | 6 #define ASH_COMMON_SHELF_SHELF_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 void OnGestureEvent(ui::GestureEvent* event) override; | 285 void OnGestureEvent(ui::GestureEvent* event) override; |
| 286 | 286 |
| 287 // Overridden from ShelfModelObserver: | 287 // Overridden from ShelfModelObserver: |
| 288 void ShelfItemAdded(int model_index) override; | 288 void ShelfItemAdded(int model_index) override; |
| 289 void ShelfItemRemoved(int model_index, ShelfID id) override; | 289 void ShelfItemRemoved(int model_index, ShelfID id) override; |
| 290 void ShelfItemChanged(int model_index, const ShelfItem& old_item) override; | 290 void ShelfItemChanged(int model_index, const ShelfItem& old_item) override; |
| 291 void ShelfItemMoved(int start_index, int target_index) override; | 291 void ShelfItemMoved(int start_index, int target_index) override; |
| 292 void OnSetShelfItemDelegate(ShelfID id, | 292 void OnSetShelfItemDelegate(ShelfID id, |
| 293 ShelfItemDelegate* item_delegate) override; | 293 ShelfItemDelegate* item_delegate) override; |
| 294 | 294 |
| 295 // Handles the result of an item selection, records the |action| taken and |
| 296 // optionally shows an application menu with the given |menu_items|. |
| 297 void AfterItemSelected(const ShelfItem& item, |
| 298 views::Button* sender, |
| 299 std::unique_ptr<ui::Event> event, |
| 300 views::InkDrop* ink_drop, |
| 301 ShelfAction action, |
| 302 ShelfItemDelegate::MenuItemList menu_items); |
| 303 |
| 295 // Show a list of all running items for this shelf |item|; it only shows a | 304 // Show a list of all running items for this shelf |item|; it only shows a |
| 296 // menu if there are multiple running items. |source| specifies the view | 305 // menu if there are multiple running items. |source| specifies the view |
| 297 // responsible for showing the menu, and the bubble will point towards it. | 306 // responsible for showing the menu, and the bubble will point towards it. |
| 298 // The |event_flags| are the flags of the event which triggered this menu. | 307 // The |event_flags| are the flags of the event which triggered this menu. |
| 299 // Returns |true| if a menu is shown. | 308 // Returns |true| if a menu is shown. |
| 300 bool ShowListMenuForView(const ShelfItem& item, | 309 bool ShowListMenuForView(const ShelfItem& item, |
| 301 views::View* source, | 310 views::View* source, |
| 302 const ui::Event& event, | 311 const ui::Event& event, |
| 303 views::InkDrop* ink_drop); | 312 views::InkDrop* ink_drop); |
| 304 | 313 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 470 |
| 462 // Tracks UMA metrics based on shelf button press actions. | 471 // Tracks UMA metrics based on shelf button press actions. |
| 463 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; | 472 ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; |
| 464 | 473 |
| 465 DISALLOW_COPY_AND_ASSIGN(ShelfView); | 474 DISALLOW_COPY_AND_ASSIGN(ShelfView); |
| 466 }; | 475 }; |
| 467 | 476 |
| 468 } // namespace ash | 477 } // namespace ash |
| 469 | 478 |
| 470 #endif // ASH_COMMON_SHELF_SHELF_VIEW_H_ | 479 #endif // ASH_COMMON_SHELF_SHELF_VIEW_H_ |
| OLD | NEW |