| 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 |
| 11 #include "ash/shelf/shelf_button_host.h" | 11 #include "ash/shelf/shelf_button_host.h" |
| 12 #include "ash/shelf/shelf_model_observer.h" | 12 #include "ash/shelf/shelf_model_observer.h" |
| 13 #include "ash/wm/gestures/shelf_gesture_handler.h" | 13 #include "ash/wm/gestures/shelf_gesture_handler.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "ui/app_list/views/app_list_drag_and_drop_host.h" | 15 #include "ui/app_list/views/app_list_drag_and_drop_host.h" |
| 16 #include "ui/views/animation/bounds_animator_observer.h" | 16 #include "ui/views/animation/bounds_animator_observer.h" |
| 17 #include "ui/views/context_menu_controller.h" | 17 #include "ui/views/context_menu_controller.h" |
| 18 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
| 19 #include "ui/views/focus/focus_manager.h" | 19 #include "ui/views/focus/focus_manager.h" |
| 20 #include "ui/views/view.h" | 20 #include "ui/views/view.h" |
| 21 | 21 |
| 22 namespace ui { |
| 23 class MenuModel; |
| 24 } |
| 25 |
| 22 namespace views { | 26 namespace views { |
| 23 class BoundsAnimator; | 27 class BoundsAnimator; |
| 24 class MenuModelAdapter; | |
| 25 class MenuRunner; | 28 class MenuRunner; |
| 26 class ViewModel; | 29 class ViewModel; |
| 27 } | 30 } |
| 28 | 31 |
| 29 namespace ash { | 32 namespace ash { |
| 30 class ShelfDelegate; | 33 class ShelfDelegate; |
| 31 class ShelfIconObserver; | 34 class ShelfIconObserver; |
| 32 class ShelfItemDelegateManager; | 35 class ShelfItemDelegateManager; |
| 33 class ShelfModel; | 36 class ShelfModel; |
| 34 struct ShelfItem; | 37 struct ShelfItem; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // The |event_flags| are the flags of the event which triggered this menu. | 286 // The |event_flags| are the flags of the event which triggered this menu. |
| 284 bool ShowListMenuForView(const ShelfItem& item, | 287 bool ShowListMenuForView(const ShelfItem& item, |
| 285 views::View* source, | 288 views::View* source, |
| 286 const ui::Event& event); | 289 const ui::Event& event); |
| 287 | 290 |
| 288 // Overridden from views::ContextMenuController: | 291 // Overridden from views::ContextMenuController: |
| 289 virtual void ShowContextMenuForView(views::View* source, | 292 virtual void ShowContextMenuForView(views::View* source, |
| 290 const gfx::Point& point, | 293 const gfx::Point& point, |
| 291 ui::MenuSourceType source_type) OVERRIDE; | 294 ui::MenuSourceType source_type) OVERRIDE; |
| 292 | 295 |
| 293 // Show either a context or normal click menu of given |menu_model_adapter|. | 296 // Show either a context or normal click menu of given |menu_model|. |
| 294 // If |context_menu| is set, the displayed menu is a context menu and not | 297 // If |context_menu| is set, the displayed menu is a context menu and not |
| 295 // a menu listing one or more running applications. | 298 // a menu listing one or more running applications. |
| 296 // The |click_point| is only used for |context_menu|'s. | 299 // The |click_point| is only used for |context_menu|'s. |
| 297 void ShowMenu(scoped_ptr<views::MenuModelAdapter> menu_model_adapter, | 300 void ShowMenu(ui::MenuModel* menu_model, |
| 298 views::View* source, | 301 views::View* source, |
| 299 const gfx::Point& click_point, | 302 const gfx::Point& click_point, |
| 300 bool context_menu, | 303 bool context_menu, |
| 301 ui::MenuSourceType source_type); | 304 ui::MenuSourceType source_type); |
| 302 | 305 |
| 303 // Overridden from views::BoundsAnimatorObserver: | 306 // Overridden from views::BoundsAnimatorObserver: |
| 304 virtual void OnBoundsAnimatorProgressed( | 307 virtual void OnBoundsAnimatorProgressed( |
| 305 views::BoundsAnimator* animator) OVERRIDE; | 308 views::BoundsAnimator* animator) OVERRIDE; |
| 306 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE; | 309 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE; |
| 307 | 310 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 int drag_offset_; | 361 int drag_offset_; |
| 359 | 362 |
| 360 // Index |drag_view_| was initially at. | 363 // Index |drag_view_| was initially at. |
| 361 int start_drag_index_; | 364 int start_drag_index_; |
| 362 | 365 |
| 363 // Used for the context menu of a particular item. | 366 // Used for the context menu of a particular item. |
| 364 ShelfID context_menu_id_; | 367 ShelfID context_menu_id_; |
| 365 | 368 |
| 366 scoped_ptr<views::FocusSearch> focus_search_; | 369 scoped_ptr<views::FocusSearch> focus_search_; |
| 367 | 370 |
| 371 scoped_ptr<ui::MenuModel> list_menu_model_; |
| 372 |
| 373 scoped_ptr<ui::MenuModel> context_menu_model_; |
| 374 |
| 368 scoped_ptr<views::MenuRunner> launcher_menu_runner_; | 375 scoped_ptr<views::MenuRunner> launcher_menu_runner_; |
| 369 | 376 |
| 370 ObserverList<ShelfIconObserver> observers_; | 377 ObserverList<ShelfIconObserver> observers_; |
| 371 | 378 |
| 372 // Amount content is inset on the left edge (or top edge for vertical | 379 // Amount content is inset on the left edge (or top edge for vertical |
| 373 // alignment). | 380 // alignment). |
| 374 int leading_inset_; | 381 int leading_inset_; |
| 375 | 382 |
| 376 ShelfGestureHandler gesture_handler_; | 383 ShelfGestureHandler gesture_handler_; |
| 377 | 384 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 440 |
| 434 // True when ripped item from overflow bubble is entered into Shelf. | 441 // True when ripped item from overflow bubble is entered into Shelf. |
| 435 bool dragged_off_from_overflow_to_shelf_; | 442 bool dragged_off_from_overflow_to_shelf_; |
| 436 | 443 |
| 437 DISALLOW_COPY_AND_ASSIGN(ShelfView); | 444 DISALLOW_COPY_AND_ASSIGN(ShelfView); |
| 438 }; | 445 }; |
| 439 | 446 |
| 440 } // namespace ash | 447 } // namespace ash |
| 441 | 448 |
| 442 #endif // ASH_SHELF_SHELF_VIEW_H_ | 449 #endif // ASH_SHELF_SHELF_VIEW_H_ |
| OLD | NEW |