Commit 2c19ad9e authored by rsorokin's avatar rsorokin Committed by Commit bot

ChromeOS Gaia: When webview is enabled CrOS get oauth_code from...

ChromeOS Gaia: When webview is enabled CrOS get oauth_code from accounts.sandbox.google.com and make all the other auths against the default gaia url.

BUG=461854

Review URL: https://codereview.chromium.org/958843003

Cr-Commit-Position: refs/heads/master@{#318228}
parent 8e95c0e7
...@@ -55,6 +55,9 @@ const char kAuthIframeParentName[] = "signin-frame"; ...@@ -55,6 +55,9 @@ const char kAuthIframeParentName[] = "signin-frame";
const char kAuthIframeParentOrigin[] = const char kAuthIframeParentOrigin[] =
"chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"; "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/";
// TODO(rsorokin): Get rid of this url before the beta release. Issue tracking
// that http://crbug/462204.
const char kStagingGaiaUrl[] = "https://accounts.sandbox.google.com/";
// TODO(rsorokin): Move this to the proper file. // TODO(rsorokin): Move this to the proper file.
const char kMinuteMaidPath[] = "ChromeOsEmbeddedSetup"; const char kMinuteMaidPath[] = "ChromeOsEmbeddedSetup";
...@@ -243,11 +246,19 @@ void GaiaScreenHandler::LoadGaia(const GaiaContext& context) { ...@@ -243,11 +246,19 @@ void GaiaScreenHandler::LoadGaia(const GaiaContext& context) {
} }
} }
const GURL gaia_url = if (StartupUtils::IsWebviewSigninEnabled()) {
command_line->HasSwitch(::switches::kGaiaUrl) // We can't use switch --gaia-url in this case cause we need get
? GURL(command_line->GetSwitchValueASCII(::switches::kGaiaUrl)) // auth_code from staging gaia and make all the other auths against prod
: GaiaUrls::GetInstance()->gaia_url(); // gaia so user could use all the google services.
params.SetString("gaiaUrl", gaia_url.spec()); const GURL gaia_url = GURL(kStagingGaiaUrl);
params.SetString("gaiaUrl", gaia_url.spec());
} else {
const GURL gaia_url =
command_line->HasSwitch(::switches::kGaiaUrl)
? GURL(command_line->GetSwitchValueASCII(::switches::kGaiaUrl))
: GaiaUrls::GetInstance()->gaia_url();
params.SetString("gaiaUrl", gaia_url.spec());
}
if (command_line->HasSwitch(switches::kGaiaEndpointChromeOS)) { if (command_line->HasSwitch(switches::kGaiaEndpointChromeOS)) {
params.SetString("gaiaEndpoint", command_line->GetSwitchValueASCII( params.SetString("gaiaEndpoint", command_line->GetSwitchValueASCII(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment