| 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_LAUNCHER_LAUNCHER_VIEW_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
| 6 #define ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/launcher/launcher_button_host.h" | 11 #include "ash/launcher/launcher_button_host.h" |
| 12 #include "ash/launcher/launcher_model_observer.h" | 12 #include "ash/launcher/launcher_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/views/animation/bounds_animator_observer.h" | 16 #include "ui/views/animation/bounds_animator_observer.h" |
| 16 #include "ui/views/context_menu_controller.h" | 17 #include "ui/views/context_menu_controller.h" |
| 17 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
| 18 #include "ui/views/focus/focus_manager.h" | 19 #include "ui/views/focus/focus_manager.h" |
| 19 #include "ui/views/view.h" | 20 #include "ui/views/view.h" |
| 20 | 21 |
| 21 namespace views { | 22 namespace views { |
| 22 class BoundsAnimator; | 23 class BoundsAnimator; |
| 23 class MenuModelAdapter; | 24 class MenuModelAdapter; |
| 24 class MenuRunner; | 25 class MenuRunner; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 class ShelfLayoutManager; | 44 class ShelfLayoutManager; |
| 44 class OverflowBubble; | 45 class OverflowBubble; |
| 45 class OverflowButton; | 46 class OverflowButton; |
| 46 | 47 |
| 47 class ASH_EXPORT LauncherView : public views::View, | 48 class ASH_EXPORT LauncherView : public views::View, |
| 48 public LauncherModelObserver, | 49 public LauncherModelObserver, |
| 49 public views::ButtonListener, | 50 public views::ButtonListener, |
| 50 public LauncherButtonHost, | 51 public LauncherButtonHost, |
| 51 public views::ContextMenuController, | 52 public views::ContextMenuController, |
| 52 public views::FocusTraversable, | 53 public views::FocusTraversable, |
| 53 public views::BoundsAnimatorObserver { | 54 public views::BoundsAnimatorObserver, |
| 55 public app_list::ApplicationDragAndDropHost { |
| 54 public: | 56 public: |
| 55 LauncherView(LauncherModel* model, | 57 LauncherView(LauncherModel* model, |
| 56 LauncherDelegate* delegate, | 58 LauncherDelegate* delegate, |
| 57 ShelfLayoutManager* shelf_layout_manager); | 59 ShelfLayoutManager* shelf_layout_manager); |
| 58 virtual ~LauncherView(); | 60 virtual ~LauncherView(); |
| 59 | 61 |
| 60 LauncherTooltipManager* tooltip_manager() { return tooltip_.get(); } | 62 LauncherTooltipManager* tooltip_manager() { return tooltip_.get(); } |
| 61 | 63 |
| 62 LauncherModel* model() { return model_; } | 64 LauncherModel* model() { return model_; } |
| 63 | 65 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 90 bool ShouldHideTooltip(const gfx::Point& cursor_location); | 92 bool ShouldHideTooltip(const gfx::Point& cursor_location); |
| 91 | 93 |
| 92 int leading_inset() const { return leading_inset_; } | 94 int leading_inset() const { return leading_inset_; } |
| 93 void set_leading_inset(int leading_inset) { leading_inset_ = leading_inset; } | 95 void set_leading_inset(int leading_inset) { leading_inset_ = leading_inset; } |
| 94 | 96 |
| 95 // Overridden from FocusTraversable: | 97 // Overridden from FocusTraversable: |
| 96 virtual views::FocusSearch* GetFocusSearch() OVERRIDE; | 98 virtual views::FocusSearch* GetFocusSearch() OVERRIDE; |
| 97 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; | 99 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; |
| 98 virtual View* GetFocusTraversableParentView() OVERRIDE; | 100 virtual View* GetFocusTraversableParentView() OVERRIDE; |
| 99 | 101 |
| 102 // Overridden from app_list::ApplicationDragAndDropHost: |
| 103 virtual bool StartDrag( |
| 104 const std::string& app_id, |
| 105 const gfx::Point& location_in_screen_coordinates) OVERRIDE; |
| 106 virtual bool Drag(const gfx::Point& location_in_screen_coordinates) OVERRIDE; |
| 107 virtual void EndDrag(bool cancel) OVERRIDE; |
| 108 |
| 100 private: | 109 private: |
| 101 friend class ash::test::LauncherViewTestAPI; | 110 friend class ash::test::LauncherViewTestAPI; |
| 102 | 111 |
| 103 class FadeOutAnimationDelegate; | 112 class FadeOutAnimationDelegate; |
| 104 class StartFadeAnimationDelegate; | 113 class StartFadeAnimationDelegate; |
| 105 | 114 |
| 106 struct IdealBounds { | 115 struct IdealBounds { |
| 107 gfx::Rect overflow_bounds; | 116 gfx::Rect overflow_bounds; |
| 108 }; | 117 }; |
| 109 | 118 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // will be equal to last_visible_index_ + 1. | 322 // will be equal to last_visible_index_ + 1. |
| 314 int last_hidden_index_; | 323 int last_hidden_index_; |
| 315 | 324 |
| 316 // The timestamp of the event which closed the last menu - or 0. | 325 // The timestamp of the event which closed the last menu - or 0. |
| 317 base::TimeDelta closing_event_time_; | 326 base::TimeDelta closing_event_time_; |
| 318 | 327 |
| 319 // When this object gets deleted while a menu is shown, this pointed | 328 // When this object gets deleted while a menu is shown, this pointed |
| 320 // element will be set to false. | 329 // element will be set to false. |
| 321 bool* got_deleted_; | 330 bool* got_deleted_; |
| 322 | 331 |
| 332 // True if a drag and drop operation created the item in the launcher and it |
| 333 // needs to be deleted again if the operation gets cancelled. |
| 334 bool drag_and_drop_item_created_; |
| 335 |
| 336 // The launcher item which is currently used for a drag and a drop operation |
| 337 // or 0 otherwise. |
| 338 LauncherID drag_and_drop_launcher_id_; |
| 339 |
| 340 // The application ID of the application which we drag and drop. |
| 341 std::string drag_and_drop_app_id_; |
| 342 |
| 323 DISALLOW_COPY_AND_ASSIGN(LauncherView); | 343 DISALLOW_COPY_AND_ASSIGN(LauncherView); |
| 324 }; | 344 }; |
| 325 | 345 |
| 326 } // namespace internal | 346 } // namespace internal |
| 327 } // namespace ash | 347 } // namespace ash |
| 328 | 348 |
| 329 #endif // ASH_LAUNCHER_LAUNCHER_VIEW_H_ | 349 #endif // ASH_LAUNCHER_LAUNCHER_VIEW_H_ |
| OLD | NEW |