| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
| 15 #include "ui/app_list/app_list_export.h" | 15 #include "ui/app_list/app_list_export.h" |
| 16 #include "ui/app_list/app_list_item_observer.h" | 16 #include "ui/app_list/app_list_item_observer.h" |
| 17 #include "ui/app_list/views/image_shadow_animator.h" | 17 #include "ui/app_list/views/image_shadow_animator.h" |
| 18 #include "ui/views/context_menu_controller.h" | 18 #include "ui/views/context_menu_controller.h" |
| 19 #include "ui/views/controls/button/custom_button.h" | 19 #include "ui/views/controls/button/custom_button.h" |
| 20 | 20 |
| 21 class SkBitmap; | 21 class SkBitmap; |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 class ImageView; | 24 class ImageView; |
| 25 class Label; | 25 class Label; |
| 26 class MenuRunner; | 26 class MenuRunner; |
| 27 class ProgressBar; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace app_list { | 30 namespace app_list { |
| 30 | 31 |
| 31 class AppListItem; | 32 class AppListItem; |
| 32 class AppsGridView; | 33 class AppsGridView; |
| 33 class ProgressBarView; | |
| 34 | 34 |
| 35 class APP_LIST_EXPORT AppListItemView : public views::CustomButton, | 35 class APP_LIST_EXPORT AppListItemView : public views::CustomButton, |
| 36 public views::ContextMenuController, | 36 public views::ContextMenuController, |
| 37 public AppListItemObserver, | 37 public AppListItemObserver, |
| 38 public ImageShadowAnimator::Delegate { | 38 public ImageShadowAnimator::Delegate { |
| 39 public: | 39 public: |
| 40 // Internal class name. | 40 // Internal class name. |
| 41 static const char kViewClassName[]; | 41 static const char kViewClassName[]; |
| 42 | 42 |
| 43 AppListItemView(AppsGridView* apps_grid_view, AppListItem* item); | 43 AppListItemView(AppsGridView* apps_grid_view, AppListItem* item); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void ItemBeingDestroyed() override; | 144 void ItemBeingDestroyed() override; |
| 145 | 145 |
| 146 const bool is_folder_; | 146 const bool is_folder_; |
| 147 const bool is_in_folder_; | 147 const bool is_in_folder_; |
| 148 | 148 |
| 149 AppListItem* item_weak_; // Owned by AppListModel. Can be NULL. | 149 AppListItem* item_weak_; // Owned by AppListModel. Can be NULL. |
| 150 | 150 |
| 151 AppsGridView* apps_grid_view_; // Parent view, owns this. | 151 AppsGridView* apps_grid_view_; // Parent view, owns this. |
| 152 views::ImageView* icon_; // Strongly typed child view. | 152 views::ImageView* icon_; // Strongly typed child view. |
| 153 views::Label* title_; // Strongly typed child view. | 153 views::Label* title_; // Strongly typed child view. |
| 154 ProgressBarView* progress_bar_; // Strongly typed child view. | 154 views::ProgressBar* progress_bar_; // Strongly typed child view. |
| 155 | 155 |
| 156 std::unique_ptr<views::MenuRunner> context_menu_runner_; | 156 std::unique_ptr<views::MenuRunner> context_menu_runner_; |
| 157 | 157 |
| 158 UIState ui_state_; | 158 UIState ui_state_; |
| 159 | 159 |
| 160 // True if scroll gestures should contribute to dragging. | 160 // True if scroll gestures should contribute to dragging. |
| 161 bool touch_dragging_; | 161 bool touch_dragging_; |
| 162 | 162 |
| 163 ImageShadowAnimator shadow_animator_; | 163 ImageShadowAnimator shadow_animator_; |
| 164 | 164 |
| 165 bool is_installing_; | 165 bool is_installing_; |
| 166 bool is_highlighted_; | 166 bool is_highlighted_; |
| 167 | 167 |
| 168 base::string16 tooltip_text_; | 168 base::string16 tooltip_text_; |
| 169 | 169 |
| 170 // A timer to defer showing drag UI when mouse is pressed. | 170 // A timer to defer showing drag UI when mouse is pressed. |
| 171 base::OneShotTimer mouse_drag_timer_; | 171 base::OneShotTimer mouse_drag_timer_; |
| 172 | 172 |
| 173 DISALLOW_COPY_AND_ASSIGN(AppListItemView); | 173 DISALLOW_COPY_AND_ASSIGN(AppListItemView); |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 } // namespace app_list | 176 } // namespace app_list |
| 177 | 177 |
| 178 #endif // UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ | 178 #endif // UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ |
| OLD | NEW |