Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 ExistingUserController::ExistingUserController(LoginDisplayHost* host) | 137 ExistingUserController::ExistingUserController(LoginDisplayHost* host) |
| 138 : login_status_consumer_(NULL), | 138 : login_status_consumer_(NULL), |
| 139 host_(host), | 139 host_(host), |
| 140 login_display_(host_->CreateLoginDisplay(this)), | 140 login_display_(host_->CreateLoginDisplay(this)), |
| 141 num_login_attempts_(0), | 141 num_login_attempts_(0), |
| 142 cros_settings_(CrosSettings::Get()), | 142 cros_settings_(CrosSettings::Get()), |
| 143 weak_factory_(this), | 143 weak_factory_(this), |
| 144 offline_failed_(false), | 144 offline_failed_(false), |
| 145 is_login_in_progress_(false), | 145 is_login_in_progress_(false), |
| 146 password_changed_(false), | 146 password_changed_(false), |
| 147 do_auto_enrollment_(false) { | 147 do_auto_enrollment_(false), |
| 148 signin_screen_ready_(false) { | |
| 148 DCHECK(current_controller_ == NULL); | 149 DCHECK(current_controller_ == NULL); |
| 149 current_controller_ = this; | 150 current_controller_ = this; |
| 150 | 151 |
| 151 registrar_.Add(this, | 152 registrar_.Add(this, |
| 152 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 153 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
| 153 content::NotificationService::AllSources()); | 154 content::NotificationService::AllSources()); |
| 154 registrar_.Add(this, | 155 registrar_.Add(this, |
| 155 chrome::NOTIFICATION_POLICY_USER_LIST_CHANGED, | 156 chrome::NOTIFICATION_POLICY_USER_LIST_CHANGED, |
| 156 content::NotificationService::AllSources()); | 157 content::NotificationService::AllSources()); |
| 157 registrar_.Add(this, | 158 registrar_.Add(this, |
| 158 chrome::NOTIFICATION_AUTH_SUPPLIED, | 159 chrome::NOTIFICATION_AUTH_SUPPLIED, |
| 159 content::NotificationService::AllSources()); | 160 content::NotificationService::AllSources()); |
| 160 registrar_.Add(this, | 161 registrar_.Add(this, |
| 161 chrome::NOTIFICATION_SESSION_STARTED, | 162 chrome::NOTIFICATION_SESSION_STARTED, |
| 162 content::NotificationService::AllSources()); | 163 content::NotificationService::AllSources()); |
| 163 cros_settings_->AddSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, this); | 164 cros_settings_->AddSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, this); |
| 164 cros_settings_->AddSettingsObserver(kAccountsPrefAllowNewUser, this); | 165 cros_settings_->AddSettingsObserver(kAccountsPrefAllowNewUser, this); |
| 165 cros_settings_->AddSettingsObserver(kAccountsPrefAllowGuest, this); | 166 cros_settings_->AddSettingsObserver(kAccountsPrefAllowGuest, this); |
| 166 cros_settings_->AddSettingsObserver(kAccountsPrefUsers, this); | 167 cros_settings_->AddSettingsObserver(kAccountsPrefUsers, this); |
| 168 cros_settings_->AddSettingsObserver( | |
| 169 kAccountsPrefDeviceLocalAccountAutoLoginUsername, | |
| 170 this); | |
| 171 cros_settings_->AddSettingsObserver( | |
| 172 kAccountsPrefDeviceLocalAccountAutoLoginTimerMillis, | |
|
bartfab (slow)
2013/02/08 18:38:42
We tend to abbreviate milliseconds as "Ms, not "Mi
dconnelly
2013/02/08 19:20:42
Done.
| |
| 173 this); | |
| 167 } | 174 } |
| 168 | 175 |
| 169 void ExistingUserController::Init(const UserList& users) { | 176 void ExistingUserController::Init(const UserList& users) { |
| 170 time_init_ = base::Time::Now(); | 177 time_init_ = base::Time::Now(); |
| 171 UpdateLoginDisplay(users); | 178 UpdateLoginDisplay(users); |
| 172 | 179 |
| 173 LoginUtils::Get()->PrewarmAuthentication(); | 180 LoginUtils::Get()->PrewarmAuthentication(); |
| 174 DBusThreadManager::Get()->GetSessionManagerClient()->EmitLoginPromptReady(); | 181 DBusThreadManager::Get()->GetSessionManagerClient()->EmitLoginPromptReady(); |
| 175 } | 182 } |
| 176 | 183 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 const content::NotificationSource& source, | 229 const content::NotificationSource& source, |
| 223 const content::NotificationDetails& details) { | 230 const content::NotificationDetails& details) { |
| 224 if (type == chrome::NOTIFICATION_SESSION_STARTED) { | 231 if (type == chrome::NOTIFICATION_SESSION_STARTED) { |
| 225 // Stop listening to any notification once session has started. | 232 // Stop listening to any notification once session has started. |
| 226 // Sign in screen objects are marked for deletion with DeleteSoon so | 233 // Sign in screen objects are marked for deletion with DeleteSoon so |
| 227 // make sure no object would be used after session has started. | 234 // make sure no object would be used after session has started. |
| 228 // http://crbug.com/125276 | 235 // http://crbug.com/125276 |
| 229 registrar_.RemoveAll(); | 236 registrar_.RemoveAll(); |
| 230 return; | 237 return; |
| 231 } | 238 } |
| 239 if (type == chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED) { | |
| 240 std::string setting = *content::Details<const std::string>(details).ptr(); | |
| 241 if (setting == kAccountsPrefDeviceLocalAccountAutoLoginUsername || | |
| 242 setting == kAccountsPrefDeviceLocalAccountAutoLoginTimerMillis) | |
| 243 StartAutoLoginTimer(); | |
| 244 } | |
| 232 if (type == chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED || | 245 if (type == chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED || |
| 233 type == chrome::NOTIFICATION_POLICY_USER_LIST_CHANGED) { | 246 type == chrome::NOTIFICATION_POLICY_USER_LIST_CHANGED) { |
| 234 if (host_ != NULL) { | 247 if (host_ != NULL) { |
| 235 // Signed settings or user list changed. Notify views and update them. | 248 // Signed settings or user list changed. Notify views and update them. |
| 236 UpdateLoginDisplay(chromeos::UserManager::Get()->GetUsers()); | 249 UpdateLoginDisplay(chromeos::UserManager::Get()->GetUsers()); |
| 237 return; | 250 return; |
| 238 } | 251 } |
| 239 } | 252 } |
| 240 if (type == chrome::NOTIFICATION_AUTH_SUPPLIED) { | 253 if (type == chrome::NOTIFICATION_AUTH_SUPPLIED) { |
| 241 // Possibly the user has authenticated against a proxy server and we might | 254 // Possibly the user has authenticated against a proxy server and we might |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 271 // ExistingUserController, private: | 284 // ExistingUserController, private: |
| 272 | 285 |
| 273 ExistingUserController::~ExistingUserController() { | 286 ExistingUserController::~ExistingUserController() { |
| 274 LoginUtils::Get()->DelegateDeleted(this); | 287 LoginUtils::Get()->DelegateDeleted(this); |
| 275 | 288 |
| 276 cros_settings_->RemoveSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, | 289 cros_settings_->RemoveSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, |
| 277 this); | 290 this); |
| 278 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowNewUser, this); | 291 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowNewUser, this); |
| 279 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowGuest, this); | 292 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowGuest, this); |
| 280 cros_settings_->RemoveSettingsObserver(kAccountsPrefUsers, this); | 293 cros_settings_->RemoveSettingsObserver(kAccountsPrefUsers, this); |
| 294 cros_settings_->RemoveSettingsObserver( | |
| 295 kAccountsPrefDeviceLocalAccountAutoLoginUsername, | |
| 296 this); | |
| 297 cros_settings_->RemoveSettingsObserver( | |
| 298 kAccountsPrefDeviceLocalAccountAutoLoginTimerMillis, | |
| 299 this); | |
| 281 | 300 |
| 282 if (current_controller_ == this) { | 301 if (current_controller_ == this) { |
| 283 current_controller_ = NULL; | 302 current_controller_ = NULL; |
| 284 } else { | 303 } else { |
| 285 NOTREACHED() << "More than one controller are alive."; | 304 NOTREACHED() << "More than one controller are alive."; |
| 286 } | 305 } |
| 287 DCHECK(login_display_.get()); | 306 DCHECK(login_display_.get()); |
| 288 } | 307 } |
| 289 | 308 |
| 290 //////////////////////////////////////////////////////////////////////////////// | 309 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 } | 424 } |
| 406 | 425 |
| 407 void ExistingUserController::PerformLogin( | 426 void ExistingUserController::PerformLogin( |
| 408 std::string username, | 427 std::string username, |
| 409 std::string password, | 428 std::string password, |
| 410 LoginPerformer::AuthorizationMode auth_mode) { | 429 LoginPerformer::AuthorizationMode auth_mode) { |
| 411 // Disable UI while loading user profile. | 430 // Disable UI while loading user profile. |
| 412 login_display_->SetUIEnabled(false); | 431 login_display_->SetUIEnabled(false); |
| 413 resume_login_callback_.Reset(); | 432 resume_login_callback_.Reset(); |
| 414 | 433 |
| 434 // Stop the autologin timer when attempting login. | |
| 435 StopAutoLoginTimer(); | |
| 436 | |
| 415 // Use the same LoginPerformer for subsequent login as it has state | 437 // Use the same LoginPerformer for subsequent login as it has state |
| 416 // such as Authenticator instance. | 438 // such as Authenticator instance. |
| 417 if (!login_performer_.get() || num_login_attempts_ <= 1) { | 439 if (!login_performer_.get() || num_login_attempts_ <= 1) { |
| 418 LoginPerformer::Delegate* delegate = this; | 440 LoginPerformer::Delegate* delegate = this; |
| 419 if (login_performer_delegate_.get()) | 441 if (login_performer_delegate_.get()) |
| 420 delegate = login_performer_delegate_.get(); | 442 delegate = login_performer_delegate_.get(); |
| 421 // Only one instance of LoginPerformer should exist at a time. | 443 // Only one instance of LoginPerformer should exist at a time. |
| 422 login_performer_.reset(NULL); | 444 login_performer_.reset(NULL); |
| 423 login_performer_.reset(new LoginPerformer(delegate)); | 445 login_performer_.reset(new LoginPerformer(delegate)); |
| 424 } | 446 } |
| 425 | 447 |
| 426 is_login_in_progress_ = true; | 448 is_login_in_progress_ = true; |
| 427 if (gaia::ExtractDomainName(username) == | 449 if (gaia::ExtractDomainName(username) == |
| 428 UserManager::kLocallyManagedUserDomain) { | 450 UserManager::kLocallyManagedUserDomain) { |
| 429 login_performer_->LoginAsLocallyManagedUser(username, password); | 451 login_performer_->LoginAsLocallyManagedUser(username, password); |
| 430 } else { | 452 } else { |
| 431 login_performer_->PerformLogin(username, password, auth_mode); | 453 login_performer_->PerformLogin(username, password, auth_mode); |
| 432 } | 454 } |
| 433 accessibility::MaybeSpeak( | 455 accessibility::MaybeSpeak( |
| 434 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN)); | 456 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN)); |
| 435 } | 457 } |
| 436 | 458 |
| 437 void ExistingUserController::LoginAsRetailModeUser() { | 459 void ExistingUserController::LoginAsRetailModeUser() { |
| 438 // Disable clicking on other windows. | 460 // Disable clicking on other windows. |
| 439 login_display_->SetUIEnabled(false); | 461 login_display_->SetUIEnabled(false); |
| 440 // TODO(rkc): Add a CHECK to make sure retail mode logins are allowed once | 462 // TODO(rkc): Add a CHECK to make sure retail mode logins are allowed once |
| 441 // the enterprise policy wiring is done for retail mode. | 463 // the enterprise policy wiring is done for retail mode. |
| 442 | 464 |
| 465 // Stop the autologin timer when attempting login. | |
| 466 StopAutoLoginTimer(); | |
| 467 | |
| 443 // Only one instance of LoginPerformer should exist at a time. | 468 // Only one instance of LoginPerformer should exist at a time. |
| 444 login_performer_.reset(NULL); | 469 login_performer_.reset(NULL); |
| 445 login_performer_.reset(new LoginPerformer(this)); | 470 login_performer_.reset(new LoginPerformer(this)); |
| 446 is_login_in_progress_ = true; | 471 is_login_in_progress_ = true; |
| 447 login_performer_->LoginRetailMode(); | 472 login_performer_->LoginRetailMode(); |
| 448 accessibility::MaybeSpeak( | 473 accessibility::MaybeSpeak( |
| 449 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_DEMOUSER)); | 474 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_DEMOUSER)); |
| 450 } | 475 } |
| 451 | 476 |
| 452 void ExistingUserController::LoginAsGuest() { | 477 void ExistingUserController::LoginAsGuest() { |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 478 // reason this has been made available to the user here is the time to tell | 503 // reason this has been made available to the user here is the time to tell |
| 479 // this nicely. | 504 // this nicely. |
| 480 login_display_->ShowError(IDS_LOGIN_ERROR_WHITELIST, 1, | 505 login_display_->ShowError(IDS_LOGIN_ERROR_WHITELIST, 1, |
| 481 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT); | 506 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT); |
| 482 // Reenable clicking on other windows and status area. | 507 // Reenable clicking on other windows and status area. |
| 483 login_display_->SetUIEnabled(true); | 508 login_display_->SetUIEnabled(true); |
| 484 display_email_.clear(); | 509 display_email_.clear(); |
| 485 return; | 510 return; |
| 486 } | 511 } |
| 487 | 512 |
| 513 // Stop the autologin timer when attempting login. | |
| 514 StopAutoLoginTimer(); | |
| 515 | |
| 488 // Only one instance of LoginPerformer should exist at a time. | 516 // Only one instance of LoginPerformer should exist at a time. |
| 489 login_performer_.reset(NULL); | 517 login_performer_.reset(NULL); |
| 490 login_performer_.reset(new LoginPerformer(this)); | 518 login_performer_.reset(new LoginPerformer(this)); |
| 491 is_login_in_progress_ = true; | 519 is_login_in_progress_ = true; |
| 492 login_performer_->LoginOffTheRecord(); | 520 login_performer_->LoginOffTheRecord(); |
| 493 accessibility::MaybeSpeak( | 521 accessibility::MaybeSpeak( |
| 494 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_OFFRECORD)); | 522 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_OFFRECORD)); |
| 495 } | 523 } |
| 496 | 524 |
| 497 void ExistingUserController::MigrateUserData(const std::string& old_password) { | 525 void ExistingUserController::MigrateUserData(const std::string& old_password) { |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 525 | 553 |
| 526 // If there is no public account with the given |username|, logging in is not | 554 // If there is no public account with the given |username|, logging in is not |
| 527 // possible. | 555 // possible. |
| 528 const User* user = UserManager::Get()->FindUser(username); | 556 const User* user = UserManager::Get()->FindUser(username); |
| 529 if (!user || user->GetType() != User::USER_TYPE_PUBLIC_ACCOUNT) { | 557 if (!user || user->GetType() != User::USER_TYPE_PUBLIC_ACCOUNT) { |
| 530 // Re-enable clicking on other windows. | 558 // Re-enable clicking on other windows. |
| 531 login_display_->SetUIEnabled(true); | 559 login_display_->SetUIEnabled(true); |
| 532 return; | 560 return; |
| 533 } | 561 } |
| 534 | 562 |
| 563 // Stop the autologin timer when attempting login. | |
| 564 StopAutoLoginTimer(); | |
| 565 | |
| 535 // Only one instance of LoginPerformer should exist at a time. | 566 // Only one instance of LoginPerformer should exist at a time. |
| 536 login_performer_.reset(NULL); | 567 login_performer_.reset(NULL); |
| 537 login_performer_.reset(new LoginPerformer(this)); | 568 login_performer_.reset(new LoginPerformer(this)); |
| 538 is_login_in_progress_ = true; | 569 is_login_in_progress_ = true; |
| 539 login_performer_->LoginAsPublicAccount(username); | 570 login_performer_->LoginAsPublicAccount(username); |
| 540 accessibility::MaybeSpeak( | 571 accessibility::MaybeSpeak( |
| 541 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_PUBLIC_ACCOUNT)); | 572 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_PUBLIC_ACCOUNT)); |
| 542 } | 573 } |
| 543 | 574 |
| 575 void ExistingUserController::OnSigninScreenReady() { | |
| 576 signin_screen_ready_ = true; | |
| 577 StartAutoLoginTimer(); | |
| 578 } | |
| 579 | |
| 544 void ExistingUserController::OnUserSelected(const std::string& username) { | 580 void ExistingUserController::OnUserSelected(const std::string& username) { |
| 545 login_performer_.reset(NULL); | 581 login_performer_.reset(NULL); |
| 546 num_login_attempts_ = 0; | 582 num_login_attempts_ = 0; |
| 547 } | 583 } |
| 548 | 584 |
| 549 void ExistingUserController::OnStartEnterpriseEnrollment() { | 585 void ExistingUserController::OnStartEnterpriseEnrollment() { |
| 550 DeviceSettingsService::Get()->GetOwnershipStatusAsync( | 586 DeviceSettingsService::Get()->GetOwnershipStatusAsync( |
| 551 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted, | 587 base::Bind(&ExistingUserController::OnEnrollmentOwnershipCheckCompleted, |
| 552 weak_factory_.GetWeakPtr())); | 588 weak_factory_.GetWeakPtr())); |
| 553 } | 589 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 674 } | 710 } |
| 675 // Reenable clicking on other windows and status area. | 711 // Reenable clicking on other windows and status area. |
| 676 login_display_->SetUIEnabled(true); | 712 login_display_->SetUIEnabled(true); |
| 677 } | 713 } |
| 678 | 714 |
| 679 if (login_status_consumer_) | 715 if (login_status_consumer_) |
| 680 login_status_consumer_->OnLoginFailure(failure); | 716 login_status_consumer_->OnLoginFailure(failure); |
| 681 | 717 |
| 682 // Clear the recorded displayed email so it won't affect any future attempts. | 718 // Clear the recorded displayed email so it won't affect any future attempts. |
| 683 display_email_.clear(); | 719 display_email_.clear(); |
| 720 | |
| 721 StartAutoLoginTimer(); | |
| 684 } | 722 } |
| 685 | 723 |
| 686 void ExistingUserController::OnLoginSuccess( | 724 void ExistingUserController::OnLoginSuccess( |
| 687 const std::string& username, | 725 const std::string& username, |
| 688 const std::string& password, | 726 const std::string& password, |
| 689 bool pending_requests, | 727 bool pending_requests, |
| 690 bool using_oauth) { | 728 bool using_oauth) { |
| 691 is_login_in_progress_ = false; | 729 is_login_in_progress_ = false; |
| 692 offline_failed_ = false; | 730 offline_failed_ = false; |
| 693 | 731 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 833 display_email_.clear(); | 871 display_email_.clear(); |
| 834 } | 872 } |
| 835 | 873 |
| 836 void ExistingUserController::PolicyLoadFailed() { | 874 void ExistingUserController::PolicyLoadFailed() { |
| 837 ShowError(IDS_LOGIN_ERROR_OWNER_KEY_LOST, ""); | 875 ShowError(IDS_LOGIN_ERROR_OWNER_KEY_LOST, ""); |
| 838 | 876 |
| 839 // Reenable clicking on other windows and status area. | 877 // Reenable clicking on other windows and status area. |
| 840 login_display_->SetUIEnabled(true); | 878 login_display_->SetUIEnabled(true); |
| 841 | 879 |
| 842 display_email_.clear(); | 880 display_email_.clear(); |
| 881 | |
| 882 // Policy load failure stops login attempts--restart the timer. | |
| 883 StartAutoLoginTimer(); | |
| 843 } | 884 } |
| 844 | 885 |
| 845 void ExistingUserController::OnOnlineChecked(const std::string& username, | 886 void ExistingUserController::OnOnlineChecked(const std::string& username, |
| 846 bool success) { | 887 bool success) { |
| 847 if (success && last_login_attempt_username_ == username) { | 888 if (success && last_login_attempt_username_ == username) { |
| 848 online_succeeded_for_ = username; | 889 online_succeeded_for_ = username; |
| 849 // Wait for login attempt to end, if it hasn't yet. | 890 // Wait for login attempt to end, if it hasn't yet. |
| 850 if (offline_failed_ && !is_login_in_progress_) | 891 if (offline_failed_ && !is_login_in_progress_) |
| 851 ShowGaiaPasswordChanged(username); | 892 ShowGaiaPasswordChanged(username); |
| 852 } | 893 } |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 874 | 915 |
| 875 void ExistingUserController::ActivateWizard(const std::string& screen_name) { | 916 void ExistingUserController::ActivateWizard(const std::string& screen_name) { |
| 876 DictionaryValue* params = NULL; | 917 DictionaryValue* params = NULL; |
| 877 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) { | 918 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) { |
| 878 params = new DictionaryValue; | 919 params = new DictionaryValue; |
| 879 params->SetString("start_url", guest_mode_url_.spec()); | 920 params->SetString("start_url", guest_mode_url_.spec()); |
| 880 } | 921 } |
| 881 host_->StartWizard(screen_name, params); | 922 host_->StartWizard(screen_name, params); |
| 882 } | 923 } |
| 883 | 924 |
| 925 void ExistingUserController::StopAutoLoginTimer() { | |
| 926 auto_login_timer_.Stop(); | |
| 927 } | |
| 928 | |
| 929 void ExistingUserController::StartAutoLoginTimer() { | |
| 930 if (!signin_screen_ready_) | |
| 931 return; | |
| 932 | |
| 933 std::string username; | |
| 934 if (cros_settings_->GetString( | |
| 935 kAccountsPrefDeviceLocalAccountAutoLoginUsername, | |
| 936 &username) && !username.empty()) { | |
| 937 int timer; | |
| 938 if (!cros_settings_->GetInteger( | |
| 939 kAccountsPrefDeviceLocalAccountAutoLoginTimerMillis, | |
| 940 &timer)) | |
| 941 timer = 0; | |
|
bartfab (slow)
2013/02/08 18:38:42
multi-line if => style guide requires curly braces
dconnelly
2013/02/08 19:20:42
Done.
| |
| 942 auto_login_timer_.Start(FROM_HERE, | |
| 943 base::TimeDelta::FromMilliseconds(timer), | |
| 944 base::Bind( | |
| 945 &ExistingUserController::LoginAsPublicAccount, | |
| 946 weak_factory_.GetWeakPtr(), | |
| 947 username)); | |
| 948 } | |
| 949 } | |
| 950 | |
| 884 gfx::NativeWindow ExistingUserController::GetNativeWindow() const { | 951 gfx::NativeWindow ExistingUserController::GetNativeWindow() const { |
| 885 return host_->GetNativeWindow(); | 952 return host_->GetNativeWindow(); |
| 886 } | 953 } |
| 887 | 954 |
| 888 void ExistingUserController::InitializeStartUrls() const { | 955 void ExistingUserController::InitializeStartUrls() const { |
| 889 std::vector<std::string> start_urls; | 956 std::vector<std::string> start_urls; |
| 890 | 957 |
| 891 PrefService* prefs = g_browser_process->local_state(); | 958 PrefService* prefs = g_browser_process->local_state(); |
| 892 const base::ListValue *urls; | 959 const base::ListValue *urls; |
| 893 bool show_getstarted_guide = false; | 960 bool show_getstarted_guide = false; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1020 username, | 1087 username, |
| 1021 CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceOAuth1) ? | 1088 CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceOAuth1) ? |
| 1022 User::OAUTH1_TOKEN_STATUS_INVALID : | 1089 User::OAUTH1_TOKEN_STATUS_INVALID : |
| 1023 User::OAUTH2_TOKEN_STATUS_INVALID); | 1090 User::OAUTH2_TOKEN_STATUS_INVALID); |
| 1024 | 1091 |
| 1025 login_display_->SetUIEnabled(true); | 1092 login_display_->SetUIEnabled(true); |
| 1026 login_display_->ShowGaiaPasswordChanged(username); | 1093 login_display_->ShowGaiaPasswordChanged(username); |
| 1027 } | 1094 } |
| 1028 | 1095 |
| 1029 } // namespace chromeos | 1096 } // namespace chromeos |
| OLD | NEW |