Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: ui/app_list/views/app_list_item_view.h

Issue 12771021: Make painting app list items more efficient by caching the labels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 10 matching lines...) Expand all
21 namespace views { 21 namespace views {
22 class ImageView; 22 class ImageView;
23 class Label; 23 class Label;
24 class MenuRunner; 24 class MenuRunner;
25 } 25 }
26 26
27 namespace app_list { 27 namespace app_list {
28 28
29 class AppListItemModel; 29 class AppListItemModel;
30 class AppsGridView; 30 class AppsGridView;
31 class CachedLabel;
31 32
32 class APP_LIST_EXPORT AppListItemView : public views::CustomButton, 33 class APP_LIST_EXPORT AppListItemView : public views::CustomButton,
33 public views::ContextMenuController, 34 public views::ContextMenuController,
34 public AppListItemModelObserver { 35 public AppListItemModelObserver {
35 public: 36 public:
36 // Internal class name. 37 // Internal class name.
37 static const char kViewClassName[]; 38 static const char kViewClassName[];
38 39
39 AppListItemView(AppsGridView* apps_grid_view, AppListItemModel* model); 40 AppListItemView(AppsGridView* apps_grid_view, AppListItemModel* model);
40 virtual ~AppListItemView(); 41 virtual ~AppListItemView();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 virtual void OnMouseCaptureLost() OVERRIDE; 89 virtual void OnMouseCaptureLost() OVERRIDE;
89 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; 90 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
90 91
91 // ui::EventHandler overrides: 92 // ui::EventHandler overrides:
92 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 93 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
93 94
94 AppListItemModel* model_; // Owned by AppListModel::Apps. 95 AppListItemModel* model_; // Owned by AppListModel::Apps.
95 96
96 AppsGridView* apps_grid_view_; // Owned by views hierarchy. 97 AppsGridView* apps_grid_view_; // Owned by views hierarchy.
97 views::ImageView* icon_; // Owned by views hierarchy. 98 views::ImageView* icon_; // Owned by views hierarchy.
98 views::Label* title_; // Owned by views hierarchy. 99 CachedLabel* title_; // Owned by views hierarchy.
99 100
100 scoped_ptr<views::MenuRunner> context_menu_runner_; 101 scoped_ptr<views::MenuRunner> context_menu_runner_;
101 102
102 gfx::Size icon_size_; 103 gfx::Size icon_size_;
103 gfx::ShadowValues icon_shadows_; 104 gfx::ShadowValues icon_shadows_;
104 105
105 UIState ui_state_; 106 UIState ui_state_;
106 107
107 // True if scroll gestures should contribute to dragging. 108 // True if scroll gestures should contribute to dragging.
108 bool touch_dragging_; 109 bool touch_dragging_;
109 110
110 // A timer to defer showing drag UI when mouse is pressed. 111 // A timer to defer showing drag UI when mouse is pressed.
111 base::OneShotTimer<AppListItemView> mouse_drag_timer_; 112 base::OneShotTimer<AppListItemView> mouse_drag_timer_;
112 113
113 DISALLOW_COPY_AND_ASSIGN(AppListItemView); 114 DISALLOW_COPY_AND_ASSIGN(AppListItemView);
114 }; 115 };
115 116
116 } // namespace app_list 117 } // namespace app_list
117 118
118 #endif // UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_ 119 #endif // UI_APP_LIST_VIEWS_APP_LIST_ITEM_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698