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 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 void SetIcon(const gfx::ImageSkia& icon); | 30 void SetIcon(const gfx::ImageSkia& icon); |
31 const gfx::ImageSkia& icon() const { return icon_; } | 31 const gfx::ImageSkia& icon() const { return icon_; } |
32 | 32 |
33 void SetTitle(const std::string& title); | 33 void SetTitle(const std::string& title); |
34 const std::string& title() const { return title_; } | 34 const std::string& title() const { return title_; } |
35 | 35 |
36 void SetHighlighted(bool highlighted); | 36 void SetHighlighted(bool highlighted); |
37 bool highlighted() const { return highlighted_; } | 37 bool highlighted() const { return highlighted_; } |
38 | 38 |
39 void SetIsInstalling(bool is_installing); | |
40 virtual bool is_installing() const { return is_installing_; } | |
tfarina
2013/02/06 15:37:34
why this needs to be virtual? Are you overriding i
xiyuan
2013/02/06 19:10:37
Right. This and percent_downloaded() below should
koz (OOO until 15th September)
2013/02/07 03:13:23
Done.
| |
41 | |
42 void SetPercentDownloaded(int percent_downloaded); | |
43 virtual int percent_downloaded() const { return percent_downloaded_; } | |
44 | |
39 void AddObserver(AppListItemModelObserver* observer); | 45 void AddObserver(AppListItemModelObserver* observer); |
40 void RemoveObserver(AppListItemModelObserver* observer); | 46 void RemoveObserver(AppListItemModelObserver* observer); |
41 | 47 |
42 // Returns the context menu model for this item. | 48 // Returns the context menu model for this item. |
43 // Note the returned menu model is owned by this item. | 49 // Note the returned menu model is owned by this item. |
44 virtual ui::MenuModel* GetContextMenuModel(); | 50 virtual ui::MenuModel* GetContextMenuModel(); |
45 | 51 |
46 private: | 52 private: |
47 gfx::ImageSkia icon_; | 53 gfx::ImageSkia icon_; |
48 std::string title_; | 54 std::string title_; |
49 bool highlighted_; | 55 bool highlighted_; |
56 bool is_installing_; | |
57 int percent_downloaded_; | |
50 | 58 |
51 ObserverList<AppListItemModelObserver> observers_; | 59 ObserverList<AppListItemModelObserver> observers_; |
52 | 60 |
53 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); | 61 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); |
54 }; | 62 }; |
55 | 63 |
56 } // namespace app_list | 64 } // namespace app_list |
57 | 65 |
58 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ | 66 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ |
OLD | NEW |