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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Return true if the |bounds_animator_| is animating |view|. | 120 // Return true if the |bounds_animator_| is animating |view|. |
121 bool IsAnimatingView(AppListItemView* view); | 121 bool IsAnimatingView(AppListItemView* view); |
122 | 122 |
123 bool has_dragged_view() const { return drag_view_ != NULL; } | 123 bool has_dragged_view() const { return drag_view_ != NULL; } |
124 bool dragging() const { return drag_pointer_ != NONE; } | 124 bool dragging() const { return drag_pointer_ != NONE; } |
125 | 125 |
126 // Gets the PaginationModel used for the grid view. | 126 // Gets the PaginationModel used for the grid view. |
127 PaginationModel* pagination_model() { return &pagination_model_; } | 127 PaginationModel* pagination_model() { return &pagination_model_; } |
128 | 128 |
129 // Overridden from views::View: | 129 // Overridden from views::View: |
130 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 130 virtual gfx::Size GetPreferredSize() const override; |
131 virtual void Layout() OVERRIDE; | 131 virtual void Layout() override; |
132 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 132 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
133 virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; | 133 virtual bool OnKeyReleased(const ui::KeyEvent& event) override; |
134 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; | 134 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override; |
135 virtual void ViewHierarchyChanged( | 135 virtual void ViewHierarchyChanged( |
136 const ViewHierarchyChangedDetails& details) OVERRIDE; | 136 const ViewHierarchyChangedDetails& details) override; |
137 virtual bool GetDropFormats( | 137 virtual bool GetDropFormats( |
138 int* formats, | 138 int* formats, |
139 std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 139 std::set<OSExchangeData::CustomFormat>* custom_formats) override; |
140 virtual bool CanDrop(const OSExchangeData& data) OVERRIDE; | 140 virtual bool CanDrop(const OSExchangeData& data) override; |
141 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 141 virtual int OnDragUpdated(const ui::DropTargetEvent& event) override; |
142 | 142 |
143 // Overridden from ui::EventHandler: | 143 // Overridden from ui::EventHandler: |
144 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 144 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
145 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; | 145 virtual void OnScrollEvent(ui::ScrollEvent* event) override; |
146 | 146 |
147 // Stops the timer that triggers a page flip during a drag. | 147 // Stops the timer that triggers a page flip during a drag. |
148 void StopPageFlipTimer(); | 148 void StopPageFlipTimer(); |
149 | 149 |
150 // Returns the item view of the item at |index|. | 150 // Returns the item view of the item at |index|. |
151 AppListItemView* GetItemViewAt(int index) const; | 151 AppListItemView* GetItemViewAt(int index) const; |
152 | 152 |
153 // Show or hide the top item views. | 153 // Show or hide the top item views. |
154 void SetTopItemViewsVisible(bool visible); | 154 void SetTopItemViewsVisible(bool visible); |
155 | 155 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 362 |
363 // Removes the AppListItemView at |index| in |view_model_| and deletes it. | 363 // Removes the AppListItemView at |index| in |view_model_| and deletes it. |
364 void DeleteItemViewAtIndex(int index); | 364 void DeleteItemViewAtIndex(int index); |
365 | 365 |
366 // Returns true if |point| lies within the bounds of this grid view plus a | 366 // Returns true if |point| lies within the bounds of this grid view plus a |
367 // buffer area surrounding it. | 367 // buffer area surrounding it. |
368 bool IsPointWithinDragBuffer(const gfx::Point& point) const; | 368 bool IsPointWithinDragBuffer(const gfx::Point& point) const; |
369 | 369 |
370 // Overridden from views::ButtonListener: | 370 // Overridden from views::ButtonListener: |
371 virtual void ButtonPressed(views::Button* sender, | 371 virtual void ButtonPressed(views::Button* sender, |
372 const ui::Event& event) OVERRIDE; | 372 const ui::Event& event) override; |
373 | 373 |
374 // Overridden from AppListItemListObserver: | 374 // Overridden from AppListItemListObserver: |
375 virtual void OnListItemAdded(size_t index, AppListItem* item) OVERRIDE; | 375 virtual void OnListItemAdded(size_t index, AppListItem* item) override; |
376 virtual void OnListItemRemoved(size_t index, AppListItem* item) OVERRIDE; | 376 virtual void OnListItemRemoved(size_t index, AppListItem* item) override; |
377 virtual void OnListItemMoved(size_t from_index, | 377 virtual void OnListItemMoved(size_t from_index, |
378 size_t to_index, | 378 size_t to_index, |
379 AppListItem* item) OVERRIDE; | 379 AppListItem* item) override; |
380 virtual void OnAppListItemHighlight(size_t index, bool highlight) OVERRIDE; | 380 virtual void OnAppListItemHighlight(size_t index, bool highlight) override; |
381 | 381 |
382 // Overridden from PaginationModelObserver: | 382 // Overridden from PaginationModelObserver: |
383 virtual void TotalPagesChanged() OVERRIDE; | 383 virtual void TotalPagesChanged() override; |
384 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; | 384 virtual void SelectedPageChanged(int old_selected, int new_selected) override; |
385 virtual void TransitionStarted() OVERRIDE; | 385 virtual void TransitionStarted() override; |
386 virtual void TransitionChanged() OVERRIDE; | 386 virtual void TransitionChanged() override; |
387 | 387 |
388 // Overridden from AppListModelObserver: | 388 // Overridden from AppListModelObserver: |
389 virtual void OnAppListModelStatusChanged() OVERRIDE; | 389 virtual void OnAppListModelStatusChanged() override; |
390 | 390 |
391 // ui::ImplicitAnimationObserver overrides: | 391 // ui::ImplicitAnimationObserver overrides: |
392 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 392 virtual void OnImplicitAnimationsCompleted() override; |
393 | 393 |
394 // Hide a given view temporarily without losing (mouse) events and / or | 394 // Hide a given view temporarily without losing (mouse) events and / or |
395 // changing the size of it. If |immediate| is set the change will be | 395 // changing the size of it. If |immediate| is set the change will be |
396 // immediately applied - otherwise it will change gradually. | 396 // immediately applied - otherwise it will change gradually. |
397 // If |hide| is set the view will get hidden, otherwise it gets shown. | 397 // If |hide| is set the view will get hidden, otherwise it gets shown. |
398 void SetViewHidden(AppListItemView* view, bool hide, bool immediate); | 398 void SetViewHidden(AppListItemView* view, bool hide, bool immediate); |
399 | 399 |
400 // Whether the folder drag-and-drop UI should be enabled. | 400 // Whether the folder drag-and-drop UI should be enabled. |
401 bool EnableFolderDragDropUI(); | 401 bool EnableFolderDragDropUI(); |
402 | 402 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 // True if the drag_view_ item is a folder item being dragged for reparenting. | 572 // True if the drag_view_ item is a folder item being dragged for reparenting. |
573 bool dragging_for_reparent_item_; | 573 bool dragging_for_reparent_item_; |
574 | 574 |
575 DISALLOW_COPY_AND_ASSIGN(AppsGridView); | 575 DISALLOW_COPY_AND_ASSIGN(AppsGridView); |
576 }; | 576 }; |
577 | 577 |
578 } // namespace app_list | 578 } // namespace app_list |
579 | 579 |
580 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ | 580 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_H_ |
OLD | NEW |