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

Unified Diff: ui/app_list/views/app_list_view.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/views/app_list_view.h ('k') | ui/app_list/views/search_box_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_view.cc
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index d0af1258c283fdf17f2fc564abdfa953b16ca82f..25085e968c82b1abc07d710c2d3d6bf9cbcc2a1f 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -52,14 +52,11 @@ AppListView::AppListView(AppListViewDelegate* delegate)
signin_view_(NULL) {
if (delegate_)
delegate_->SetModel(model_.get());
- if (GetSigninDelegate())
- GetSigninDelegate()->AddObserver(this);
+ model_->AddObserver(this);
}
AppListView::~AppListView() {
- if (GetSigninDelegate())
- GetSigninDelegate()->RemoveObserver(this);
-
+ model_->RemoveObserver(this);
// Models are going away, ensure their references are cleared.
RemoveAllChildViews(true);
}
@@ -175,11 +172,8 @@ void AppListView::Prerender() {
}
void AppListView::OnSigninStatusChanged() {
- const bool needs_signin =
- GetSigninDelegate() && GetSigninDelegate()->NeedSignin();
-
- signin_view_->SetVisible(needs_signin);
- app_list_main_view_->SetVisible(!needs_signin);
+ signin_view_->SetVisible(!model_->signed_in());
+ app_list_main_view_->SetVisible(model_->signed_in());
app_list_main_view_->search_box_view()->InvalidateMenu();
}
@@ -277,12 +271,16 @@ void AppListView::OnWidgetVisibilityChanged(views::Widget* widget,
Layout();
}
-void AppListView::OnSigninSuccess() {
+SigninDelegate* AppListView::GetSigninDelegate() {
+ return delegate_ ? delegate_->GetSigninDelegate() : NULL;
+}
+
+void AppListView::OnAppListModelSigninStatusChanged() {
OnSigninStatusChanged();
}
-SigninDelegate* AppListView::GetSigninDelegate() {
- return delegate_ ? delegate_->GetSigninDelegate() : NULL;
+void AppListView::OnAppListModelCurrentUserChanged() {
+ OnSigninStatusChanged();
}
} // namespace app_list
« no previous file with comments | « ui/app_list/views/app_list_view.h ('k') | ui/app_list/views/search_box_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698