Chromium Code Reviews| Index: ui/app_list/app_list_model.h |
| diff --git a/ui/app_list/app_list_model.h b/ui/app_list/app_list_model.h |
| index 4c46a0123297d05aed9d25ece397e5506475c711..4a173980a332fcf4a9eb81ff4fec65b3677e9caf 100644 |
| --- a/ui/app_list/app_list_model.h |
| +++ b/ui/app_list/app_list_model.h |
| @@ -5,12 +5,19 @@ |
| #ifndef UI_APP_LIST_APP_LIST_MODEL_H_ |
| #define UI_APP_LIST_APP_LIST_MODEL_H_ |
| +#include <vector> |
| + |
| #include "base/basictypes.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/observer_list.h" |
| +#include "base/strings/string16.h" |
| #include "ui/app_list/app_list_export.h" |
| #include "ui/base/models/list_model.h" |
| +namespace ui{ |
|
tapted
2013/07/31 05:43:53
nit: space before {
calamity
2013/08/01 08:35:45
Done.
|
| +struct AvatarMenuItemModel; |
| +} |
| + |
| namespace app_list { |
| class AppListItemModel; |
| @@ -39,18 +46,30 @@ class APP_LIST_EXPORT AppListModel { |
| void RemoveObserver(AppListModelObserver* observer); |
| void SetStatus(Status status); |
| + void SetCurrentUser(string16 user_name, string16 user_email); |
|
tapted
2013/07/31 05:43:53
nit: const-reference args for strings
calamity
2013/08/01 08:35:45
Done.
|
| Apps* apps() { return apps_.get(); } |
| SearchBoxModel* search_box() { return search_box_.get(); } |
| SearchResults* results() { return results_.get(); } |
| Status status() const { return status_; } |
| + string16 current_user_name() { return current_user_name_; } |
|
tapted
2013/07/31 05:43:53
I've seen new code using base::string16 a lot more
calamity
2013/08/01 08:35:45
Done.
|
| + string16 current_user_email() { return current_user_email_; } |
|
tapted
2013/07/31 05:43:53
Also, most app list code returns const-references
calamity
2013/08/01 08:35:45
Done.
|
| + |
| + std::vector<ui::AvatarMenuItemModel*>& avatar_menu_items() { |
| + return avatar_menu_items_; |
| + } |
| + |
| private: |
| scoped_ptr<Apps> apps_; |
| scoped_ptr<SearchBoxModel> search_box_; |
| scoped_ptr<SearchResults> results_; |
| + string16 current_user_name_; |
| + string16 current_user_email_; |
| + std::vector<ui::AvatarMenuItemModel*> avatar_menu_items_; |
|
tapted
2013/07/31 05:43:53
a thought: you could also use a ScopedVector - not
calamity
2013/08/01 08:35:45
Also might be worth using a ui::ListModel since it
|
| + |
| Status status_; |
| ObserverList<AppListModelObserver> observers_; |