| 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_APP_LIST_ITEM_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ |
| 6 #define UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 const views::Label* title() const { return title_; } | 58 const views::Label* title() const { return title_; } |
| 59 | 59 |
| 60 // In a synchronous drag the item view isn't informed directly of the drag | 60 // In a synchronous drag the item view isn't informed directly of the drag |
| 61 // ending, so the runner of the drag should call this. | 61 // ending, so the runner of the drag should call this. |
| 62 void OnSyncDragEnd(); | 62 void OnSyncDragEnd(); |
| 63 | 63 |
| 64 // Returns the icon bounds relative to AppListItemView. | 64 // Returns the icon bounds relative to AppListItemView. |
| 65 const gfx::Rect& GetIconBounds() const; | 65 const gfx::Rect& GetIconBounds() const; |
| 66 | 66 |
| 67 // Sets UI state to dragging state. |
| 68 void SetDragUIState(); |
| 69 |
| 70 // Returns the icon bounds for the given |target_bounds| as |
| 71 // the assuming bounds of this view. |
| 72 gfx::Rect GetIconBoundsForTargetViewBounds(const gfx::Rect& target_bounds); |
| 73 |
| 67 private: | 74 private: |
| 68 enum UIState { | 75 enum UIState { |
| 69 UI_STATE_NORMAL, // Normal UI (icon + label) | 76 UI_STATE_NORMAL, // Normal UI (icon + label) |
| 70 UI_STATE_DRAGGING, // Dragging UI (scaled icon only) | 77 UI_STATE_DRAGGING, // Dragging UI (scaled icon only) |
| 71 UI_STATE_DROPPING_IN_FOLDER, // Folder dropping preview UI | 78 UI_STATE_DROPPING_IN_FOLDER, // Folder dropping preview UI |
| 72 }; | 79 }; |
| 73 | 80 |
| 74 // Get icon from |item_| and schedule background processing. | 81 // Get icon from |item_| and schedule background processing. |
| 75 void UpdateIcon(); | 82 void UpdateIcon(); |
| 76 | 83 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 143 |
| 137 // A timer to defer showing drag UI when mouse is pressed. | 144 // A timer to defer showing drag UI when mouse is pressed. |
| 138 base::OneShotTimer<AppListItemView> mouse_drag_timer_; | 145 base::OneShotTimer<AppListItemView> mouse_drag_timer_; |
| 139 | 146 |
| 140 DISALLOW_COPY_AND_ASSIGN(AppListItemView); | 147 DISALLOW_COPY_AND_ASSIGN(AppListItemView); |
| 141 }; | 148 }; |
| 142 | 149 |
| 143 } // namespace app_list | 150 } // namespace app_list |
| 144 | 151 |
| 145 #endif // UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ | 152 #endif // UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ |
| OLD | NEW |