Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: ui/app_list/app_list_model.cc

Issue 22268009: Move signin status and current user information into AppListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_model.h ('k') | ui/app_list/app_list_model_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_model.cc
diff --git a/ui/app_list/app_list_model.cc b/ui/app_list/app_list_model.cc
index 4f473efbc36a7fe0e134522219338ae7f13e0dc4..a932069d26cacb0dc6cc468edc9f8c25518ebfa5 100644
--- a/ui/app_list/app_list_model.cc
+++ b/ui/app_list/app_list_model.cc
@@ -15,6 +15,7 @@ AppListModel::AppListModel()
: apps_(new Apps),
search_box_(new SearchBoxModel),
results_(new SearchResults),
+ signed_in_(false),
status_(STATUS_NORMAL) {
}
@@ -39,4 +40,27 @@ void AppListModel::SetStatus(Status status) {
OnAppListModelStatusChanged());
}
+void AppListModel::SetCurrentUser(const base::string16& current_user_name,
+ const base::string16& current_user_email) {
+ if (current_user_name_ == current_user_name &&
+ current_user_email_ == current_user_email) {
+ return;
+ }
+ current_user_name_ = current_user_name;
+ current_user_email_ = current_user_email;
+ FOR_EACH_OBSERVER(AppListModelObserver,
+ observers_,
+ OnAppListModelCurrentUserChanged());
+}
+
+void AppListModel::SetSignedIn(bool signed_in) {
+ if (signed_in_ == signed_in)
+ return;
+
+ signed_in_ = signed_in;
+ FOR_EACH_OBSERVER(AppListModelObserver,
+ observers_,
+ OnAppListModelSigninStatusChanged());
+}
+
} // namespace app_list
« no previous file with comments | « ui/app_list/app_list_model.h ('k') | ui/app_list/app_list_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698