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

Side by Side Diff: ui/app_list/app_list_item.h

Issue 1154323002: Use app list item shadow for app list folders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_arrow_keys_crash
Patch Set: fix mac compile Created 5 years, 6 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
« no previous file with comments | « ui/app_list/app_list_folder_item.cc ('k') | ui/app_list/app_list_item.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_APP_LIST_ITEM_H_ 5 #ifndef UI_APP_LIST_APP_LIST_ITEM_H_
6 #define UI_APP_LIST_APP_LIST_ITEM_H_ 6 #define UI_APP_LIST_APP_LIST_ITEM_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 15 matching lines...) Expand all
26 class AppListItemObserver; 26 class AppListItemObserver;
27 class AppListModel; 27 class AppListModel;
28 28
29 // AppListItem provides icon and title to be shown in a AppListItemView 29 // AppListItem provides icon and title to be shown in a AppListItemView
30 // and action to be executed when the AppListItemView is activated. 30 // and action to be executed when the AppListItemView is activated.
31 class APP_LIST_EXPORT AppListItem { 31 class APP_LIST_EXPORT AppListItem {
32 public: 32 public:
33 explicit AppListItem(const std::string& id); 33 explicit AppListItem(const std::string& id);
34 virtual ~AppListItem(); 34 virtual ~AppListItem();
35 35
36 void SetIcon(const gfx::ImageSkia& icon, bool has_shadow); 36 void SetIcon(const gfx::ImageSkia& icon);
37 const gfx::ImageSkia& icon() const { return icon_; } 37 const gfx::ImageSkia& icon() const { return icon_; }
38 bool has_shadow() const { return has_shadow_; }
39 38
40 const std::string& GetDisplayName() const { 39 const std::string& GetDisplayName() const {
41 return short_name_.empty() ? name_ : short_name_; 40 return short_name_.empty() ? name_ : short_name_;
42 } 41 }
43 42
44 const std::string& name() const { return name_; } 43 const std::string& name() const { return name_; }
45 // Should only be used in tests; otheriwse use GetDisplayName(). 44 // Should only be used in tests; otheriwse use GetDisplayName().
46 const std::string& short_name() const { return short_name_; } 45 const std::string& short_name() const { return short_name_; }
47 46
48 void set_highlighted(bool highlighted) { highlighted_ = highlighted; } 47 void set_highlighted(bool highlighted) { highlighted_ = highlighted; }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 113
115 void set_folder_id(const std::string& folder_id) { folder_id_ = folder_id; } 114 void set_folder_id(const std::string& folder_id) { folder_id_ = folder_id; }
116 115
117 private: 116 private:
118 friend class AppListModelTest; 117 friend class AppListModelTest;
119 118
120 const std::string id_; 119 const std::string id_;
121 std::string folder_id_; // Id of containing folder; empty if top level item. 120 std::string folder_id_; // Id of containing folder; empty if top level item.
122 syncer::StringOrdinal position_; 121 syncer::StringOrdinal position_;
123 gfx::ImageSkia icon_; 122 gfx::ImageSkia icon_;
124 bool has_shadow_;
125 123
126 // The full name of an item. Used for display if |short_name_| is empty. 124 // The full name of an item. Used for display if |short_name_| is empty.
127 std::string name_; 125 std::string name_;
128 126
129 // A shortened name for the item, used for display. 127 // A shortened name for the item, used for display.
130 std::string short_name_; 128 std::string short_name_;
131 129
132 bool highlighted_; 130 bool highlighted_;
133 bool is_installing_; 131 bool is_installing_;
134 int percent_downloaded_; 132 int percent_downloaded_;
135 133
136 ObserverList<AppListItemObserver> observers_; 134 ObserverList<AppListItemObserver> observers_;
137 135
138 DISALLOW_COPY_AND_ASSIGN(AppListItem); 136 DISALLOW_COPY_AND_ASSIGN(AppListItem);
139 }; 137 };
140 138
141 } // namespace app_list 139 } // namespace app_list
142 140
143 #endif // UI_APP_LIST_APP_LIST_ITEM_H_ 141 #endif // UI_APP_LIST_APP_LIST_ITEM_H_
OLDNEW
« no previous file with comments | « ui/app_list/app_list_folder_item.cc ('k') | ui/app_list/app_list_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698