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 views { | 22 namespace views { |
23 class BoundsAnimator; | 23 class BoundsAnimator; |
24 class MenuModelAdapter; | 24 class MenuModelAdapter; |
25 class MenuRunner; | 25 class MenuRunner; |
26 class ViewModel; | 26 class ViewModel; |
27 } | 27 } |
28 | 28 |
29 namespace ash { | 29 namespace ash { |
30 | |
31 namespace test { | |
32 class ShelfViewTestAPI; | |
33 } | |
34 | |
35 class ShelfDelegate; | 30 class ShelfDelegate; |
36 class ShelfIconObserver; | 31 class ShelfIconObserver; |
37 class ShelfItemDelegateManager; | 32 class ShelfItemDelegateManager; |
38 class ShelfModel; | 33 class ShelfModel; |
39 struct ShelfItem; | 34 struct ShelfItem; |
40 | |
41 namespace internal { | |
42 | |
43 class DragImageView; | 35 class DragImageView; |
44 class OverflowBubble; | 36 class OverflowBubble; |
45 class OverflowButton; | 37 class OverflowButton; |
46 class ShelfButton; | 38 class ShelfButton; |
47 class ShelfLayoutManager; | 39 class ShelfLayoutManager; |
48 class ShelfTooltipManager; | 40 class ShelfTooltipManager; |
49 | 41 |
| 42 namespace test { |
| 43 class ShelfViewTestAPI; |
| 44 } |
| 45 |
50 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM; | 46 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM; |
51 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT; | 47 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT; |
52 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT; | 48 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT; |
53 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT; | 49 extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT; |
54 | 50 |
55 class ASH_EXPORT ShelfView : public views::View, | 51 class ASH_EXPORT ShelfView : public views::View, |
56 public ShelfModelObserver, | 52 public ShelfModelObserver, |
57 public views::ButtonListener, | 53 public views::ButtonListener, |
58 public ShelfButtonHost, | 54 public ShelfButtonHost, |
59 public views::ContextMenuController, | 55 public views::ContextMenuController, |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 ShelfID drag_and_drop_shelf_id_; | 409 ShelfID drag_and_drop_shelf_id_; |
414 | 410 |
415 // The application ID of the application which we drag and drop. | 411 // The application ID of the application which we drag and drop. |
416 std::string drag_and_drop_app_id_; | 412 std::string drag_and_drop_app_id_; |
417 | 413 |
418 // The original launcher item's size before the dragging operation. | 414 // The original launcher item's size before the dragging operation. |
419 gfx::Size pre_drag_and_drop_size_; | 415 gfx::Size pre_drag_and_drop_size_; |
420 | 416 |
421 // The image proxy for drag operations when a drag and drop host exists and | 417 // The image proxy for drag operations when a drag and drop host exists and |
422 // the item can be dragged outside the app grid. | 418 // the item can be dragged outside the app grid. |
423 scoped_ptr<ash::internal::DragImageView> drag_image_; | 419 scoped_ptr<ash::DragImageView> drag_image_; |
424 | 420 |
425 // The cursor offset to the middle of the dragged item. | 421 // The cursor offset to the middle of the dragged item. |
426 gfx::Vector2d drag_image_offset_; | 422 gfx::Vector2d drag_image_offset_; |
427 | 423 |
428 // The view which gets replaced by our drag icon proxy. | 424 // The view which gets replaced by our drag icon proxy. |
429 views::View* drag_replaced_view_; | 425 views::View* drag_replaced_view_; |
430 | 426 |
431 // True when the icon was dragged off the shelf. | 427 // True when the icon was dragged off the shelf. |
432 bool dragged_off_shelf_; | 428 bool dragged_off_shelf_; |
433 | 429 |
(...skipping 11 matching lines...) Expand all Loading... |
445 | 441 |
446 // Holds a pointer to main ShelfView when a ShelfView is in overflow mode. | 442 // Holds a pointer to main ShelfView when a ShelfView is in overflow mode. |
447 ShelfView* main_shelf_; | 443 ShelfView* main_shelf_; |
448 | 444 |
449 // True when ripped item from overflow bubble is entered into Shelf. | 445 // True when ripped item from overflow bubble is entered into Shelf. |
450 bool dragged_off_from_overflow_to_shelf_; | 446 bool dragged_off_from_overflow_to_shelf_; |
451 | 447 |
452 DISALLOW_COPY_AND_ASSIGN(ShelfView); | 448 DISALLOW_COPY_AND_ASSIGN(ShelfView); |
453 }; | 449 }; |
454 | 450 |
455 } // namespace internal | |
456 } // namespace ash | 451 } // namespace ash |
457 | 452 |
458 #endif // ASH_SHELF_SHELF_VIEW_H_ | 453 #endif // ASH_SHELF_SHELF_VIEW_H_ |
OLD | NEW |