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

Side by Side Diff: chrome/browser/ui/webui/options/supervised_user_import_handler.cc

Issue 479353003: Add IsAuthenticated() method to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chrome/browser/ui/webui/options/supervised_user_import_handler.h" 5 #include "chrome/browser/ui/webui/options/supervised_user_import_handler.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 void SupervisedUserImportHandler::ClearSupervisedUsersAndShowError() { 214 void SupervisedUserImportHandler::ClearSupervisedUsersAndShowError() {
215 web_ui()->CallJavascriptFunction( 215 web_ui()->CallJavascriptFunction(
216 "options.SupervisedUserListData.onSigninError"); 216 "options.SupervisedUserListData.onSigninError");
217 } 217 }
218 218
219 bool SupervisedUserImportHandler::IsAccountConnected() const { 219 bool SupervisedUserImportHandler::IsAccountConnected() const {
220 Profile* profile = Profile::FromWebUI(web_ui()); 220 Profile* profile = Profile::FromWebUI(web_ui());
221 SigninManagerBase* signin_manager = 221 SigninManagerBase* signin_manager =
222 SigninManagerFactory::GetForProfile(profile); 222 SigninManagerFactory::GetForProfile(profile);
223 return signin_manager && !signin_manager->GetAuthenticatedUsername().empty(); 223 return signin_manager && signin_manager->IsAuthenticated();
224 } 224 }
225 225
226 bool SupervisedUserImportHandler::HasAuthError() const { 226 bool SupervisedUserImportHandler::HasAuthError() const {
227 Profile* profile = Profile::FromWebUI(web_ui()); 227 Profile* profile = Profile::FromWebUI(web_ui());
228 ProfileOAuth2TokenService* token_service = 228 ProfileOAuth2TokenService* token_service =
229 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); 229 ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
230 if (!token_service) 230 if (!token_service)
231 return true; 231 return true;
232 232
233 SigninErrorController* error_controller = 233 SigninErrorController* error_controller =
(...skipping 12 matching lines...) Expand all
246 const std::string& key) { 246 const std::string& key) {
247 if (key == supervised_users::kChromeAvatarIndex) 247 if (key == supervised_users::kChromeAvatarIndex)
248 FetchSupervisedUsers(); 248 FetchSupervisedUsers();
249 } 249 }
250 250
251 void SupervisedUserImportHandler::OnErrorChanged() { 251 void SupervisedUserImportHandler::OnErrorChanged() {
252 FetchSupervisedUsers(); 252 FetchSupervisedUsers();
253 } 253 }
254 254
255 } // namespace options 255 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui_browsertest.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698