OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/login/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 void SigninScreenHandler::ShowSigninScreenForCreds( | 868 void SigninScreenHandler::ShowSigninScreenForCreds( |
869 const std::string& username, | 869 const std::string& username, |
870 const std::string& password) { | 870 const std::string& password) { |
871 VLOG(2) << "ShowSigninScreenForCreds " << username << " " << password; | 871 VLOG(2) << "ShowSigninScreenForCreds " << username << " " << password; |
872 | 872 |
873 test_user_ = username; | 873 test_user_ = username; |
874 test_pass_ = password; | 874 test_pass_ = password; |
875 HandleShowAddUser(NULL); | 875 HandleShowAddUser(NULL); |
876 } | 876 } |
877 | 877 |
| 878 void SigninScreenHandler::SetGaiaOriginForTesting(const std::string& arg) { |
| 879 gaia_origin_for_test_ = arg; |
| 880 } |
| 881 |
878 void SigninScreenHandler::OnBrowsingDataRemoverDone() { | 882 void SigninScreenHandler::OnBrowsingDataRemoverDone() { |
879 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 883 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
880 cookie_remover_ = NULL; | 884 cookie_remover_ = NULL; |
881 cookies_cleared_ = true; | 885 cookies_cleared_ = true; |
882 cookie_remover_callback_.Run(); | 886 cookie_remover_callback_.Run(); |
883 cookie_remover_callback_.Reset(); | 887 cookie_remover_callback_.Reset(); |
884 } | 888 } |
885 | 889 |
886 void SigninScreenHandler::OnCapsLockChange(bool enabled) { | 890 void SigninScreenHandler::OnCapsLockChange(bool enabled) { |
887 if (page_is_ready()) { | 891 if (page_is_ready()) { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_SIGNIN)); | 1007 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_SIGNIN)); |
1004 localized_strings->SetString("stringEmptyEmail", | 1008 localized_strings->SetString("stringEmptyEmail", |
1005 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_EMAIL)); | 1009 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_EMAIL)); |
1006 localized_strings->SetString("stringEmptyPassword", | 1010 localized_strings->SetString("stringEmptyPassword", |
1007 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD)); | 1011 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD)); |
1008 localized_strings->SetString("stringError", | 1012 localized_strings->SetString("stringError", |
1009 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR)); | 1013 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR)); |
1010 params.Set("localizedStrings", localized_strings); | 1014 params.Set("localizedStrings", localized_strings); |
1011 } | 1015 } |
1012 | 1016 |
1013 params.SetString("gaiaOrigin", GaiaUrls::GetInstance()->gaia_origin_url()); | 1017 std::string gaia_origin = GaiaUrls::GetInstance()->gaia_origin_url(); |
| 1018 if (!gaia_origin_for_test_.empty()) |
| 1019 gaia_origin = gaia_origin_for_test_; |
| 1020 params.SetString("gaiaOrigin", gaia_origin); |
1014 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1021 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1015 if (command_line->HasSwitch(::switches::kGaiaUrlPath)) { | 1022 if (command_line->HasSwitch(::switches::kGaiaUrlPath)) { |
1016 params.SetString("gaiaUrlPath", | 1023 params.SetString("gaiaUrlPath", |
1017 command_line->GetSwitchValueASCII(::switches::kGaiaUrlPath)); | 1024 command_line->GetSwitchValueASCII(::switches::kGaiaUrlPath)); |
1018 } | 1025 } |
1019 | 1026 |
1020 // Test automation data: | 1027 // Test automation data: |
1021 if (command_line->HasSwitch(::switches::kAuthExtensionPath)) { | 1028 if (command_line->HasSwitch(::switches::kAuthExtensionPath)) { |
1022 if (!test_user_.empty()) { | 1029 if (!test_user_.empty()) { |
1023 params.SetString("test_email", test_user_); | 1030 params.SetString("test_email", test_user_); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 if (!cros_settings) | 1666 if (!cros_settings) |
1660 return false; | 1667 return false; |
1661 | 1668 |
1662 // Offline login is allowed only when user pods are hidden. | 1669 // Offline login is allowed only when user pods are hidden. |
1663 bool show_pods; | 1670 bool show_pods; |
1664 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1671 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
1665 return !show_pods; | 1672 return !show_pods; |
1666 } | 1673 } |
1667 | 1674 |
1668 } // namespace chromeos | 1675 } // namespace chromeos |
OLD | NEW |