| 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 UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ |
| 6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void UpdateDrag(Pointer pointer, const gfx::Point& point); | 110 void UpdateDrag(Pointer pointer, const gfx::Point& point); |
| 111 void EndDrag(bool cancel); | 111 void EndDrag(bool cancel); |
| 112 bool IsDraggedView(const views::View* view) const; | 112 bool IsDraggedView(const views::View* view) const; |
| 113 void ClearDragState(); | 113 void ClearDragState(); |
| 114 void SetDragViewVisible(bool visible); | 114 void SetDragViewVisible(bool visible); |
| 115 | 115 |
| 116 // Set the drag and drop host for application links. | 116 // Set the drag and drop host for application links. |
| 117 void SetDragAndDropHostOfCurrentAppList( | 117 void SetDragAndDropHostOfCurrentAppList( |
| 118 ApplicationDragAndDropHost* drag_and_drop_host); | 118 ApplicationDragAndDropHost* drag_and_drop_host); |
| 119 | 119 |
| 120 // Prerenders the icons on and around |page_index|. | 120 // Prerenders the icons on and around the currently selected page. |
| 121 void Prerender(int page_index); | 121 void Prerender(); |
| 122 | 122 |
| 123 // Return true if the |bounds_animator_| is animating |view|. | 123 // Return true if the |bounds_animator_| is animating |view|. |
| 124 bool IsAnimatingView(views::View* view); | 124 bool IsAnimatingView(views::View* view); |
| 125 | 125 |
| 126 bool has_dragged_view() const { return drag_view_ != NULL; } | 126 bool has_dragged_view() const { return drag_view_ != NULL; } |
| 127 bool dragging() const { return drag_pointer_ != NONE; } | 127 bool dragging() const { return drag_pointer_ != NONE; } |
| 128 | 128 |
| 129 // Gets the PaginationModel used for the grid view. | 129 // Gets the PaginationModel used for the grid view. |
| 130 PaginationModel* pagination_model() { return &pagination_model_; } | 130 PaginationModel* pagination_model() { return &pagination_model_; } |
| 131 | 131 |
| 132 // Overridden from views::View: | 132 // Overridden from views::View: |
| 133 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 133 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 134 virtual void Layout() OVERRIDE; | 134 virtual void Layout() OVERRIDE; |
| 135 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 135 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| 136 virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; | 136 virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; |
| 137 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; |
| 137 virtual void ViewHierarchyChanged( | 138 virtual void ViewHierarchyChanged( |
| 138 const ViewHierarchyChangedDetails& details) OVERRIDE; | 139 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 139 virtual bool GetDropFormats( | 140 virtual bool GetDropFormats( |
| 140 int* formats, | 141 int* formats, |
| 141 std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 142 std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
| 142 virtual bool CanDrop(const OSExchangeData& data) OVERRIDE; | 143 virtual bool CanDrop(const OSExchangeData& data) OVERRIDE; |
| 143 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 144 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
| 144 | 145 |
| 146 // Overridden from ui::EventHandler: |
| 147 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| 148 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; |
| 149 |
| 145 // Stops the timer that triggers a page flip during a drag. | 150 // Stops the timer that triggers a page flip during a drag. |
| 146 void StopPageFlipTimer(); | 151 void StopPageFlipTimer(); |
| 147 | 152 |
| 148 // Returns the item view of the item at |index|. | 153 // Returns the item view of the item at |index|. |
| 149 AppListItemView* GetItemViewAt(int index) const; | 154 AppListItemView* GetItemViewAt(int index) const; |
| 150 | 155 |
| 151 // Show or hide the top item views. | 156 // Show or hide the top item views. |
| 152 void SetTopItemViewsVisible(bool visible); | 157 void SetTopItemViewsVisible(bool visible); |
| 153 | 158 |
| 154 // Schedules an animation to show or hide the view. | 159 // Schedules an animation to show or hide the view. |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 | 551 |
| 547 // True if the drag_view_ item is a folder item being dragged for reparenting. | 552 // True if the drag_view_ item is a folder item being dragged for reparenting. |
| 548 bool dragging_for_reparent_item_; | 553 bool dragging_for_reparent_item_; |
| 549 | 554 |
| 550 DISALLOW_COPY_AND_ASSIGN(AppsGridView); | 555 DISALLOW_COPY_AND_ASSIGN(AppsGridView); |
| 551 }; | 556 }; |
| 552 | 557 |
| 553 } // namespace app_list | 558 } // namespace app_list |
| 554 | 559 |
| 555 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ | 560 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ |
| OLD | NEW |