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_APP_LIST_ITEM_MODEL_H_ | 5 #ifndef UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ |
6 #define UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ | 6 #define UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 // and action to be executed when the AppListItemView is activated. | 24 // and action to be executed when the AppListItemView is activated. |
25 class APP_LIST_EXPORT AppListItemModel { | 25 class APP_LIST_EXPORT AppListItemModel { |
26 public: | 26 public: |
27 AppListItemModel(); | 27 AppListItemModel(); |
28 virtual ~AppListItemModel(); | 28 virtual ~AppListItemModel(); |
29 | 29 |
30 void SetIcon(const gfx::ImageSkia& icon, bool has_shadow); | 30 void SetIcon(const gfx::ImageSkia& icon, bool has_shadow); |
31 const gfx::ImageSkia& icon() const { return icon_; } | 31 const gfx::ImageSkia& icon() const { return icon_; } |
32 bool has_shadow() const { return has_shadow_; } | 32 bool has_shadow() const { return has_shadow_; } |
33 | 33 |
34 void SetTitle(const std::string& title); | 34 void SetTitle(const std::string& title); |
tapted
2013/08/30 01:51:29
What do people think about changing this to
void
tmdiep
2013/08/30 02:48:13
Agreed, I think this is a good idea.
| |
35 const std::string& title() const { return title_; } | 35 const std::string& title() const { return title_; } |
36 | 36 |
37 void SetFullName(const std::string& full_name); | |
38 const std::string& full_name() const { return full_name_; } | |
39 | |
37 void SetHighlighted(bool highlighted); | 40 void SetHighlighted(bool highlighted); |
38 bool highlighted() const { return highlighted_; } | 41 bool highlighted() const { return highlighted_; } |
39 | 42 |
40 void SetIsInstalling(bool is_installing); | 43 void SetIsInstalling(bool is_installing); |
41 bool is_installing() const { return is_installing_; } | 44 bool is_installing() const { return is_installing_; } |
42 | 45 |
43 void SetPercentDownloaded(int percent_downloaded); | 46 void SetPercentDownloaded(int percent_downloaded); |
44 int percent_downloaded() const { return percent_downloaded_; } | 47 int percent_downloaded() const { return percent_downloaded_; } |
45 | 48 |
46 void set_app_id(const std::string& app_id) { app_id_ = app_id; } | 49 void set_app_id(const std::string& app_id) { app_id_ = app_id; } |
47 const std::string& app_id() { return app_id_; } | 50 const std::string& app_id() { return app_id_; } |
48 | 51 |
49 void AddObserver(AppListItemModelObserver* observer); | 52 void AddObserver(AppListItemModelObserver* observer); |
50 void RemoveObserver(AppListItemModelObserver* observer); | 53 void RemoveObserver(AppListItemModelObserver* observer); |
51 | 54 |
52 // Returns the context menu model for this item, or NULL if there is currently | 55 // Returns the context menu model for this item, or NULL if there is currently |
53 // no menu for the item (e.g. during install). | 56 // no menu for the item (e.g. during install). |
54 // Note the returned menu model is owned by this item. | 57 // Note the returned menu model is owned by this item. |
55 virtual ui::MenuModel* GetContextMenuModel(); | 58 virtual ui::MenuModel* GetContextMenuModel(); |
56 | 59 |
57 private: | 60 private: |
58 gfx::ImageSkia icon_; | 61 gfx::ImageSkia icon_; |
59 bool has_shadow_; | 62 bool has_shadow_; |
60 std::string title_; | 63 std::string title_; |
64 std::string full_name_; | |
61 bool highlighted_; | 65 bool highlighted_; |
62 bool is_installing_; | 66 bool is_installing_; |
63 int percent_downloaded_; | 67 int percent_downloaded_; |
64 std::string app_id_; | 68 std::string app_id_; |
65 | 69 |
66 ObserverList<AppListItemModelObserver> observers_; | 70 ObserverList<AppListItemModelObserver> observers_; |
67 | 71 |
68 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); | 72 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); |
69 }; | 73 }; |
70 | 74 |
71 } // namespace app_list | 75 } // namespace app_list |
72 | 76 |
73 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ | 77 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ |
OLD | NEW |