| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/gaia_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 "stringEmptyPassword", | 225 "stringEmptyPassword", |
| 226 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD)); | 226 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD)); |
| 227 localized_strings->SetString( | 227 localized_strings->SetString( |
| 228 "stringError", l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR)); | 228 "stringError", l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR)); |
| 229 params.Set("localizedStrings", localized_strings); | 229 params.Set("localizedStrings", localized_strings); |
| 230 } | 230 } |
| 231 | 231 |
| 232 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 232 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 233 | 233 |
| 234 if (StartupUtils::IsWebviewSigninEnabled()) { | 234 if (StartupUtils::IsWebviewSigninEnabled()) { |
| 235 params.SetBoolean("useMinuteMaid", true); | 235 params.SetBoolean("useNewGaiaFlow", true); |
| 236 | 236 |
| 237 policy::BrowserPolicyConnectorChromeOS* connector = | 237 policy::BrowserPolicyConnectorChromeOS* connector = |
| 238 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 238 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 239 std::string enterprise_domain(connector->GetEnterpriseDomain()); | 239 std::string enterprise_domain(connector->GetEnterpriseDomain()); |
| 240 if (!enterprise_domain.empty()) | 240 if (!enterprise_domain.empty()) |
| 241 params.SetString("enterpriseDomain", enterprise_domain); | 241 params.SetString("enterpriseDomain", enterprise_domain); |
| 242 | 242 |
| 243 params.SetString("chromeType", GetChromeDeviceTypeString()); | 243 params.SetString("chromeType", GetChromeDeviceTypeString()); |
| 244 params.SetString("clientId", | 244 params.SetString("clientId", |
| 245 GaiaUrls::GetInstance()->oauth2_chrome_client_id()); | 245 GaiaUrls::GetInstance()->oauth2_chrome_client_id()); |
| 246 if (!command_line->HasSwitch(switches::kGaiaEndpointChromeOS)) { | 246 if (!command_line->HasSwitch(switches::kGaiaEndpointChromeOS)) { |
| 247 command_line->AppendSwitchASCII(switches::kGaiaEndpointChromeOS, | 247 command_line->AppendSwitchASCII(switches::kGaiaEndpointChromeOS, |
| 248 kNewGaiaFlowPath); | 248 kNewGaiaFlowPath); |
| 249 } | 249 } |
| 250 } else { | 250 } else { |
| 251 params.SetBoolean("useMinuteMaid", false); | 251 params.SetBoolean("useNewGaiaFlow", false); |
| 252 } | 252 } |
| 253 | 253 |
| 254 if (!command_line->HasSwitch(::switches::kGaiaUrl) && | 254 if (!command_line->HasSwitch(::switches::kGaiaUrl) && |
| 255 command_line->HasSwitch(kGaiaSandboxUrlSwitch) && | 255 command_line->HasSwitch(kGaiaSandboxUrlSwitch) && |
| 256 StartupUtils::IsWebviewSigninEnabled()) { | 256 StartupUtils::IsWebviewSigninEnabled()) { |
| 257 // We can't use switch --gaia-url in this case cause we need get | 257 // We can't use switch --gaia-url in this case cause we need get |
| 258 // auth_code from staging gaia and make all the other auths against prod | 258 // auth_code from staging gaia and make all the other auths against prod |
| 259 // gaia so user could use all the google services. | 259 // gaia so user could use all the google services. |
| 260 // Default to production Gaia for MM unless --gaia-url or --gaia-sandbox-url | 260 // Default to production Gaia for MM unless --gaia-url or --gaia-sandbox-url |
| 261 // is specified. | 261 // is specified. |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 821 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 822 DCHECK(signin_screen_handler_); | 822 DCHECK(signin_screen_handler_); |
| 823 return signin_screen_handler_->delegate_; | 823 return signin_screen_handler_->delegate_; |
| 824 } | 824 } |
| 825 | 825 |
| 826 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 826 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
| 827 signin_screen_handler_ = handler; | 827 signin_screen_handler_ = handler; |
| 828 } | 828 } |
| 829 | 829 |
| 830 } // namespace chromeos | 830 } // namespace chromeos |
| OLD | NEW |