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 196adc44cf24ed19ce9fd3747b05794bec986720..29e0d8c0ed5fb9dfc508c9bf90ae891bb6a9d68c 100644 |
| --- a/ui/app_list/app_list_model.h |
| +++ b/ui/app_list/app_list_model.h |
| @@ -5,7 +5,10 @@ |
| #ifndef UI_APP_LIST_APP_LIST_MODEL_H_ |
| #define UI_APP_LIST_APP_LIST_MODEL_H_ |
| +#include <vector> |
| + |
| #include "base/basictypes.h" |
| +#include "base/files/file_path.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/observer_list.h" |
| #include "base/strings/string16.h" |
| @@ -25,6 +28,21 @@ class SearchResult; |
| // the model for SearchBoxView. SearchResults owns a list of SearchResult. |
| class APP_LIST_EXPORT AppListModel { |
| public: |
| + // A user of the app list. |
| + struct User { |
| + // Whether or not the app list is currently instantiated for this user. |
|
koz (OOO until 15th September)
2013/09/09 22:58:07
Maybe "Whether or not this user is the current use
calamity
2013/09/10 22:50:46
Done.
|
| + bool active; |
|
tapted
2013/09/10 00:29:26
You should probably initialize |active| to somethi
calamity
2013/09/10 22:50:46
Done.
|
| + |
| + // The name of this user. |
| + string16 name; |
|
tapted
2013/09/10 00:29:26
nit: base::string16 unless there's a prevailing co
calamity
2013/09/10 22:50:46
Done.
|
| + |
| + // The email address of this user. |
| + string16 email; |
| + |
| + // The path to this user's profile directory. |
| + base::FilePath profile_path; |
| + }; |
| + |
| enum Status { |
| STATUS_NORMAL, |
| STATUS_SYNCING, // Syncing apps or installing synced apps. |
| @@ -32,6 +50,7 @@ class APP_LIST_EXPORT AppListModel { |
| typedef ui::ListModel<AppListItemModel> Apps; |
| typedef ui::ListModel<SearchResult> SearchResults; |
| + typedef std::vector<User*> Users; |
|
koz (OOO until 15th September)
2013/09/09 22:58:07
You should just use User here, not User*. This is
calamity
2013/09/10 22:50:46
Done.
|
| AppListModel(); |
| ~AppListModel(); |
| @@ -40,8 +59,7 @@ class APP_LIST_EXPORT AppListModel { |
| void RemoveObserver(AppListModelObserver* observer); |
| void SetStatus(Status status); |
| - void SetCurrentUser(const base::string16& current_user_name, |
| - const base::string16& current_user_email); |
| + void SetUsers(const Users& profile_menu_items); |
| void SetSignedIn(bool signed_in); |
| Apps* apps() { return apps_.get(); } |
| @@ -49,9 +67,9 @@ class APP_LIST_EXPORT AppListModel { |
| SearchResults* results() { return results_.get(); } |
| Status status() const { return status_; } |
| bool signed_in() const { return signed_in_; } |
| - const base::string16& current_user_name() const { return current_user_name_; } |
| - const base::string16& current_user_email() const { |
| - return current_user_email_; |
| + |
| + const Users& users() const { |
| + return users_; |
| } |
| private: |
| @@ -63,6 +81,7 @@ class APP_LIST_EXPORT AppListModel { |
| base::string16 current_user_name_; |
|
tapted
2013/09/10 00:29:26
is this (and current_user_email_) still needed?
calamity
2013/09/10 22:50:46
Removed.
|
| base::string16 current_user_email_; |
| bool signed_in_; |
| + Users users_; |
|
tapted
2013/09/10 00:29:26
nit: maybe move above signed_in_ -- it's nice to k
calamity
2013/09/10 22:50:46
Done.
|
| Status status_; |
| ObserverList<AppListModelObserver> observers_; |