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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 void SetPercentDownloaded(int percent_downloaded); | 45 void SetPercentDownloaded(int percent_downloaded); |
46 int percent_downloaded() const { return percent_downloaded_; } | 46 int percent_downloaded() const { return percent_downloaded_; } |
47 | 47 |
48 void set_app_id(const std::string& app_id) { app_id_ = app_id; } | 48 void set_app_id(const std::string& app_id) { app_id_ = app_id; } |
49 const std::string& app_id() { return app_id_; } | 49 const std::string& app_id() { return app_id_; } |
50 | 50 |
51 void AddObserver(AppListItemModelObserver* observer); | 51 void AddObserver(AppListItemModelObserver* observer); |
52 void RemoveObserver(AppListItemModelObserver* observer); | 52 void RemoveObserver(AppListItemModelObserver* observer); |
53 | 53 |
| 54 // Activates (opens) the item. Does nothing by default. |
| 55 virtual void Activate(int event_flags); |
| 56 |
54 // Returns the context menu model for this item, or NULL if there is currently | 57 // Returns the context menu model for this item, or NULL if there is currently |
55 // no menu for the item (e.g. during install). | 58 // no menu for the item (e.g. during install). |
56 // Note the returned menu model is owned by this item. | 59 // Note the returned menu model is owned by this item. |
57 virtual ui::MenuModel* GetContextMenuModel(); | 60 virtual ui::MenuModel* GetContextMenuModel(); |
58 | 61 |
59 private: | 62 private: |
60 gfx::ImageSkia icon_; | 63 gfx::ImageSkia icon_; |
61 bool has_shadow_; | 64 bool has_shadow_; |
62 std::string title_; | 65 std::string title_; |
63 std::string full_name_; | 66 std::string full_name_; |
64 bool highlighted_; | 67 bool highlighted_; |
65 bool is_installing_; | 68 bool is_installing_; |
66 int percent_downloaded_; | 69 int percent_downloaded_; |
67 std::string app_id_; | 70 std::string app_id_; |
68 | 71 |
69 ObserverList<AppListItemModelObserver> observers_; | 72 ObserverList<AppListItemModelObserver> observers_; |
70 | 73 |
71 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); | 74 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace app_list | 77 } // namespace app_list |
75 | 78 |
76 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ | 79 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ |
OLD | NEW |