| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } else { | 259 } else { |
| 260 if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && | 260 if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && |
| 261 failure.error().state() == GoogleServiceAuthError::CAPTCHA_REQUIRED) { | 261 failure.error().state() == GoogleServiceAuthError::CAPTCHA_REQUIRED) { |
| 262 if (!failure.error().captcha().image_url.is_empty()) { | 262 if (!failure.error().captcha().image_url.is_empty()) { |
| 263 CaptchaView* view = | 263 CaptchaView* view = |
| 264 new CaptchaView(failure.error().captcha().image_url, false); | 264 new CaptchaView(failure.error().captcha().image_url, false); |
| 265 view->Init(); | 265 view->Init(); |
| 266 view->set_delegate(this); | 266 view->set_delegate(this); |
| 267 views::Window* window = browser::CreateViewsWindow( | 267 views::Window* window = browser::CreateViewsWindow( |
| 268 GetNativeWindow(), gfx::Rect(), view); | 268 GetNativeWindow(), gfx::Rect(), view); |
| 269 window->SetAlwaysOnTop(true); | 269 window->SetIsAlwaysOnTop(true); |
| 270 window->Show(); | 270 window->Show(); |
| 271 } else { | 271 } else { |
| 272 LOG(WARNING) << "No captcha image url was found?"; | 272 LOG(WARNING) << "No captcha image url was found?"; |
| 273 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error); | 273 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error); |
| 274 } | 274 } |
| 275 } else if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && | 275 } else if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && |
| 276 failure.error().state() == | 276 failure.error().state() == |
| 277 GoogleServiceAuthError::HOSTED_NOT_ALLOWED) { | 277 GoogleServiceAuthError::HOSTED_NOT_ALLOWED) { |
| 278 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING_HOSTED, error); | 278 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING_HOSTED, error); |
| 279 } else if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && | 279 } else if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 } | 403 } |
| 404 // TODO(altimofeev): remove this constrain when full sync for the owner will | 404 // TODO(altimofeev): remove this constrain when full sync for the owner will |
| 405 // be correctly handled. | 405 // be correctly handled. |
| 406 bool full_sync_disabled = (UserCrosSettingsProvider::cached_owner() == | 406 bool full_sync_disabled = (UserCrosSettingsProvider::cached_owner() == |
| 407 last_login_attempt_username_); | 407 last_login_attempt_username_); |
| 408 | 408 |
| 409 PasswordChangedView* view = new PasswordChangedView(this, full_sync_disabled); | 409 PasswordChangedView* view = new PasswordChangedView(this, full_sync_disabled); |
| 410 views::Window* window = browser::CreateViewsWindow(GetNativeWindow(), | 410 views::Window* window = browser::CreateViewsWindow(GetNativeWindow(), |
| 411 gfx::Rect(), | 411 gfx::Rect(), |
| 412 view); | 412 view); |
| 413 window->SetAlwaysOnTop(true); | 413 window->SetIsAlwaysOnTop(true); |
| 414 window->Show(); | 414 window->Show(); |
| 415 | 415 |
| 416 if (login_status_consumer_) | 416 if (login_status_consumer_) |
| 417 login_status_consumer_->OnPasswordChangeDetected(credentials); | 417 login_status_consumer_->OnPasswordChangeDetected(credentials); |
| 418 } | 418 } |
| 419 | 419 |
| 420 void ExistingUserController::WhiteListCheckFailed(const std::string& email) { | 420 void ExistingUserController::WhiteListCheckFailed(const std::string& email) { |
| 421 ShowError(IDS_LOGIN_ERROR_WHITELIST, email); | 421 ShowError(IDS_LOGIN_ERROR_WHITELIST, email); |
| 422 | 422 |
| 423 // Reenable clicking on other windows and status area. | 423 // Reenable clicking on other windows and status area. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 } | 507 } |
| 508 if (CrosLibrary::Get()->EnsureLoaded()) { | 508 if (CrosLibrary::Get()->EnsureLoaded()) { |
| 509 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); | 509 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); |
| 510 cryptohomed->AsyncSetOwnerUser( | 510 cryptohomed->AsyncSetOwnerUser( |
| 511 UserCrosSettingsProvider::cached_owner(), NULL); | 511 UserCrosSettingsProvider::cached_owner(), NULL); |
| 512 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL); | 512 cryptohomed->AsyncDoAutomaticFreeDiskSpaceControl(NULL); |
| 513 } | 513 } |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace chromeos | 516 } // namespace chromeos |
| OLD | NEW |