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 SetName(const std::string& title, const std::string& full_name); |
benwells
2013/08/30 06:25:07
Nit: I'd prefer SetTitleAndFullName.
tmdiep
2013/08/30 07:29:52
Done.
| |
35 const std::string& title() const { return title_; } | 35 const std::string& title() const { return title_; } |
36 const std::string& full_name() const { return full_name_; } | |
36 | 37 |
37 void SetHighlighted(bool highlighted); | 38 void SetHighlighted(bool highlighted); |
38 bool highlighted() const { return highlighted_; } | 39 bool highlighted() const { return highlighted_; } |
39 | 40 |
40 void SetIsInstalling(bool is_installing); | 41 void SetIsInstalling(bool is_installing); |
41 bool is_installing() const { return is_installing_; } | 42 bool is_installing() const { return is_installing_; } |
42 | 43 |
43 void SetPercentDownloaded(int percent_downloaded); | 44 void SetPercentDownloaded(int percent_downloaded); |
44 int percent_downloaded() const { return percent_downloaded_; } | 45 int percent_downloaded() const { return percent_downloaded_; } |
45 | 46 |
46 void set_app_id(const std::string& app_id) { app_id_ = app_id; } | 47 void set_app_id(const std::string& app_id) { app_id_ = app_id; } |
47 const std::string& app_id() { return app_id_; } | 48 const std::string& app_id() { return app_id_; } |
48 | 49 |
49 void AddObserver(AppListItemModelObserver* observer); | 50 void AddObserver(AppListItemModelObserver* observer); |
50 void RemoveObserver(AppListItemModelObserver* observer); | 51 void RemoveObserver(AppListItemModelObserver* observer); |
51 | 52 |
52 // Returns the context menu model for this item, or NULL if there is currently | 53 // Returns the context menu model for this item, or NULL if there is currently |
53 // no menu for the item (e.g. during install). | 54 // no menu for the item (e.g. during install). |
54 // Note the returned menu model is owned by this item. | 55 // Note the returned menu model is owned by this item. |
55 virtual ui::MenuModel* GetContextMenuModel(); | 56 virtual ui::MenuModel* GetContextMenuModel(); |
56 | 57 |
57 private: | 58 private: |
58 gfx::ImageSkia icon_; | 59 gfx::ImageSkia icon_; |
59 bool has_shadow_; | 60 bool has_shadow_; |
60 std::string title_; | 61 std::string title_; |
62 std::string full_name_; | |
61 bool highlighted_; | 63 bool highlighted_; |
62 bool is_installing_; | 64 bool is_installing_; |
63 int percent_downloaded_; | 65 int percent_downloaded_; |
64 std::string app_id_; | 66 std::string app_id_; |
65 | 67 |
66 ObserverList<AppListItemModelObserver> observers_; | 68 ObserverList<AppListItemModelObserver> observers_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); | 70 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace app_list | 73 } // namespace app_list |
72 | 74 |
73 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ | 75 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ |
OLD | NEW |