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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_SIGNIN)); | 1103 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_SIGNIN)); |
1104 localized_strings->SetString("stringEmptyEmail", | 1104 localized_strings->SetString("stringEmptyEmail", |
1105 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_EMAIL)); | 1105 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_EMAIL)); |
1106 localized_strings->SetString("stringEmptyPassword", | 1106 localized_strings->SetString("stringEmptyPassword", |
1107 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD)); | 1107 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD)); |
1108 localized_strings->SetString("stringError", | 1108 localized_strings->SetString("stringError", |
1109 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR)); | 1109 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR)); |
1110 params.Set("localizedStrings", localized_strings); | 1110 params.Set("localizedStrings", localized_strings); |
1111 } | 1111 } |
1112 | 1112 |
1113 params.SetString("gaiaOrigin", GaiaUrls::GetInstance()->gaia_origin_url()); | 1113 std::string gaia_origin = GaiaUrls::GetInstance()->gaia_origin_url(); |
| 1114 if (http_for_gaia_) |
| 1115 gaia_origin = "http" + gaia_origin.substr(arraysize("https") - 1); |
| 1116 params.SetString("gaiaOrigin", gaia_origin); |
1114 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1117 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1115 if (command_line->HasSwitch(::switches::kGaiaUrlPath)) { | 1118 if (command_line->HasSwitch(::switches::kGaiaUrlPath)) { |
1116 params.SetString("gaiaUrlPath", | 1119 params.SetString("gaiaUrlPath", |
1117 command_line->GetSwitchValueASCII(::switches::kGaiaUrlPath)); | 1120 command_line->GetSwitchValueASCII(::switches::kGaiaUrlPath)); |
1118 } | 1121 } |
1119 | 1122 |
1120 // Test automation data: | 1123 // Test automation data: |
1121 if (command_line->HasSwitch(::switches::kAuthExtensionPath)) { | 1124 if (command_line->HasSwitch(::switches::kAuthExtensionPath)) { |
1122 if (!test_user_.empty()) { | 1125 if (!test_user_.empty()) { |
1123 params.SetString("test_email", test_user_); | 1126 params.SetString("test_email", test_user_); |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 CrosSettings* cros_settings = CrosSettings::Get(); | 1750 CrosSettings* cros_settings = CrosSettings::Get(); |
1748 if (!cros_settings) | 1751 if (!cros_settings) |
1749 return false; | 1752 return false; |
1750 | 1753 |
1751 // Offline login is allowed only when user pods are hidden. | 1754 // Offline login is allowed only when user pods are hidden. |
1752 bool show_pods; | 1755 bool show_pods; |
1753 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1756 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
1754 return !show_pods; | 1757 return !show_pods; |
1755 } | 1758 } |
1756 | 1759 |
| 1760 bool SigninScreenHandler::http_for_gaia_ = false; |
| 1761 |
1757 } // namespace chromeos | 1762 } // namespace chromeos |
OLD | NEW |