Commit 41a571ab authored by alemate's avatar alemate Committed by Commit Bot

ChromeOS: Enable Gaia v2 API by default.

BUG=709244

Review-Url: https://codereview.chromium.org/2952903002
Cr-Commit-Position: refs/heads/master@{#481630}
parent 77dc2435
......@@ -348,9 +348,17 @@ void GaiaScreenHandler::LoadGaiaWithVersion(
params.SetString("gaiaUrl", eafe_url);
params.SetString("gaiaPath", eafe_path);
}
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kCrosGaiaApiV1)) {
params.SetString("chromeOSApiVersion", "1");
} else if (use_easy_bootstrap_) {
// Easy bootstrap is not v2-compatible
params.SetString("chromeOSApiVersion", "1");
} else {
// This enables GLIF MM UI for the online Gaia screen by default.
// (see https://crbug.com/709244 ).
params.SetString("chromeOSApiVersion", "2");
}
frame_state_ = FRAME_STATE_LOADING;
......
......@@ -245,7 +245,10 @@ void FakeGaia::Initialize() {
gaia_urls->service_login_url(), HandleServiceLogin);
// Handles /embedded/setup/chromeos GAIA call.
REGISTER_RESPONSE_HANDLER(gaia_urls->embedded_setup_chromeos_url(),
REGISTER_RESPONSE_HANDLER(gaia_urls->embedded_setup_chromeos_url(1),
HandleEmbeddedSetupChromeos);
// Handles /embedded/setup/v2/chromeos GAIA call.
REGISTER_RESPONSE_HANDLER(gaia_urls->embedded_setup_chromeos_url(2),
HandleEmbeddedSetupChromeos);
// Handles /OAuthLogin GAIA call.
......
......@@ -20,7 +20,8 @@ const char kDefaultGoogleApisBaseUrl[] = "https://www.googleapis.com";
// API calls from accounts.google.com
const char kClientLoginUrlSuffix[] = "ClientLogin";
const char kServiceLoginUrlSuffix[] = "ServiceLogin";
const char kEmbeddedSetupChromeOsUrlSuffix[] = "embedded/setup/chromeos";
const char kEmbeddedSetupChromeOsUrlSuffixV1[] = "embedded/setup/chromeos";
const char kEmbeddedSetupChromeOsUrlSuffixV2[] = "embedded/setup/v2/chromeos";
const char kServiceLoginAuthUrlSuffix[] = "ServiceLoginAuth";
const char kServiceLogoutUrlSuffix[] = "Logout";
const char kIssueAuthTokenUrlSuffix[] = "IssueAuthToken";
......@@ -97,8 +98,10 @@ GaiaUrls::GaiaUrls() {
// URLs from accounts.google.com.
client_login_url_ = gaia_url_.Resolve(kClientLoginUrlSuffix);
service_login_url_ = gaia_url_.Resolve(kServiceLoginUrlSuffix);
embedded_setup_chromeos_url_ =
gaia_url_.Resolve(kEmbeddedSetupChromeOsUrlSuffix);
embedded_setup_chromeos_url_v1_ =
gaia_url_.Resolve(kEmbeddedSetupChromeOsUrlSuffixV1);
embedded_setup_chromeos_url_v2_ =
gaia_url_.Resolve(kEmbeddedSetupChromeOsUrlSuffixV2);
service_login_auth_url_ = gaia_url_.Resolve(kServiceLoginAuthUrlSuffix);
service_logout_url_ = gaia_url_.Resolve(kServiceLogoutUrlSuffix);
issue_auth_token_url_ = gaia_url_.Resolve(kIssueAuthTokenUrlSuffix);
......@@ -160,8 +163,13 @@ const GURL& GaiaUrls::service_login_url() const {
return service_login_url_;
}
const GURL& GaiaUrls::embedded_setup_chromeos_url() const {
return embedded_setup_chromeos_url_;
const GURL& GaiaUrls::embedded_setup_chromeos_url(unsigned version) const {
DCHECK_GT(version, 0U);
DCHECK_LE(version, 2U);
if (version == 2U)
return embedded_setup_chromeos_url_v2_;
return embedded_setup_chromeos_url_v1_;
}
......
......@@ -22,7 +22,7 @@ class GaiaUrls {
const GURL& captcha_base_url() const;
const GURL& client_login_url() const;
const GURL& service_login_url() const;
const GURL& embedded_setup_chromeos_url() const;
const GURL& embedded_setup_chromeos_url(unsigned version) const;
const GURL& service_login_auth_url() const;
const GURL& service_logout_url() const;
const GURL& issue_auth_token_url() const;
......@@ -72,7 +72,8 @@ class GaiaUrls {
GURL client_login_url_;
GURL service_login_url_;
GURL embedded_setup_chromeos_url_;
GURL embedded_setup_chromeos_url_v1_;
GURL embedded_setup_chromeos_url_v2_;
GURL service_login_auth_url_;
GURL service_logout_url_;
GURL issue_auth_token_url_;
......
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