| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 namespace { | 51 namespace { |
| 52 | 52 |
| 53 const char kJsScreenPath[] = "login.GaiaSigninScreen"; | 53 const char kJsScreenPath[] = "login.GaiaSigninScreen"; |
| 54 const char kAuthIframeParentName[] = "signin-frame"; | 54 const char kAuthIframeParentName[] = "signin-frame"; |
| 55 const char kAuthIframeParentOrigin[] = | 55 const char kAuthIframeParentOrigin[] = |
| 56 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"; | 56 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"; |
| 57 | 57 |
| 58 const char kGaiaSandboxUrlSwitch[] = "gaia-sandbox-url"; | 58 const char kGaiaSandboxUrlSwitch[] = "gaia-sandbox-url"; |
| 59 // TODO(rsorokin): Move this to the proper file. | 59 // TODO(rsorokin): Move this to the proper file. |
| 60 const char kMinuteMaidPath[] = "ChromeOsEmbeddedSetup"; | 60 const char kNewGaiaFlowPath[] = "embedded/setup/chromeos"; |
| 61 | 61 |
| 62 void UpdateAuthParams(base::DictionaryValue* params, | 62 void UpdateAuthParams(base::DictionaryValue* params, |
| 63 bool has_users, | 63 bool has_users, |
| 64 bool is_enrolling_consumer_management) { | 64 bool is_enrolling_consumer_management) { |
| 65 CrosSettings* cros_settings = CrosSettings::Get(); | 65 CrosSettings* cros_settings = CrosSettings::Get(); |
| 66 bool allow_new_user = true; | 66 bool allow_new_user = true; |
| 67 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 67 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 68 bool allow_guest = true; | 68 bool allow_guest = true; |
| 69 cros_settings->GetBoolean(kAccountsPrefAllowGuest, &allow_guest); | 69 cros_settings->GetBoolean(kAccountsPrefAllowGuest, &allow_guest); |
| 70 // Account creation depends on Guest sign-in (http://crosbug.com/24570). | 70 // Account creation depends on Guest sign-in (http://crosbug.com/24570). |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 kMinuteMaidPath); | 248 kNewGaiaFlowPath); |
| 249 } | 249 } |
| 250 } else { | 250 } else { |
| 251 params.SetBoolean("useMinuteMaid", false); | 251 params.SetBoolean("useMinuteMaid", 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 |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 820 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 821 DCHECK(signin_screen_handler_); | 821 DCHECK(signin_screen_handler_); |
| 822 return signin_screen_handler_->delegate_; | 822 return signin_screen_handler_->delegate_; |
| 823 } | 823 } |
| 824 | 824 |
| 825 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 825 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
| 826 signin_screen_handler_ = handler; | 826 signin_screen_handler_ = handler; |
| 827 } | 827 } |
| 828 | 828 |
| 829 } // namespace chromeos | 829 } // namespace chromeos |
| OLD | NEW |