diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 18:32:28 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 18:32:28 +0000 |
commit | 6847ed64c92231392ef79db0c1c1ce7349f93948 (patch) | |
tree | d4ac69e279724ba1cef383820b5b609a42000ef8 /chrome/browser | |
parent | 826012343fb2a661c7dda67f078b89fcf536e22b (diff) | |
download | chromium_src-6847ed64c92231392ef79db0c1c1ce7349f93948.zip chromium_src-6847ed64c92231392ef79db0c1c1ce7349f93948.tar.gz chromium_src-6847ed64c92231392ef79db0c1c1ce7349f93948.tar.bz2 |
Update GAIA URL to accounts.google.com/... from www.google.com/accounts/...
BUG=127147
TEST=all serivices dependent on GAIA auth should still work (sync, login, policy, drive...)
Review URL: https://chromiumcodereview.appspot.com/10382077
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136345 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
13 files changed, 64 insertions, 47 deletions
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index b9ff80a..bd37226 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -83,7 +83,7 @@ const char kGetStartedInitialLocaleParam[] = "initial_locale"; // URL for account creation. const char kCreateAccountURL[] = - "https://www.google.com/accounts/NewAccount?service=mail"; + "https://accounts.google.com/NewAccount?service=mail"; // ChromeVox tutorial URL (used in place of "getting started" url when // accessibility is enabled). diff --git a/chrome/browser/chromeos/login/mock_url_fetchers.cc b/chrome/browser/chromeos/login/mock_url_fetchers.cc index 5795f59..440d827 100644 --- a/chrome/browser/chromeos/login/mock_url_fetchers.cc +++ b/chrome/browser/chromeos/login/mock_url_fetchers.cc @@ -100,7 +100,7 @@ void FailFetcher::Start() { // static const char CaptchaFetcher::kCaptchaToken[] = "token"; // static -const char CaptchaFetcher::kCaptchaUrlBase[] = "http://www.google.com/accounts/"; +const char CaptchaFetcher::kCaptchaUrlBase[] = "http://accounts.google.com/"; // static const char CaptchaFetcher::kCaptchaUrlFragment[] = "fragment"; // static diff --git a/chrome/browser/chromeos/login/online_attempt_unittest.cc b/chrome/browser/chromeos/login/online_attempt_unittest.cc index fb098b7..1586ef9 100644 --- a/chrome/browser/chromeos/login/online_attempt_unittest.cc +++ b/chrome/browser/chromeos/login/online_attempt_unittest.cc @@ -22,11 +22,11 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using content::BrowserThread; using ::testing::AnyNumber; using ::testing::Invoke; using ::testing::Return; using ::testing::_; +using content::BrowserThread; namespace chromeos { @@ -248,7 +248,7 @@ TEST_F(OnlineAttemptTest, CaptchaErrorOutputted) { GoogleServiceAuthError auth_error = GoogleServiceAuthError::FromClientLoginCaptchaChallenge( "CCTOKEN", - GURL("http://www.google.com/accounts/Captcha?ctoken=CCTOKEN"), + GURL("http://accounts.google.com/Captcha?ctoken=CCTOKEN"), GURL("http://www.google.com/login/captcha")); RunFailureTest(auth_error); } diff --git a/chrome/browser/importer/importer_host.cc b/chrome/browser/importer/importer_host.cc index 27c70d2..7138711 100644 --- a/chrome/browser/importer/importer_host.cc +++ b/chrome/browser/importer/importer_host.cc @@ -168,7 +168,7 @@ void ImporterHost::OnGoogleGAIACookieChecked(bool result) { L"", MB_OK | MB_TOPMOST); - GURL url("https://www.google.com/accounts/ServiceLogin"); + GURL url("https://accounts.google.com/ServiceLogin"); DCHECK(profile_); Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); if (browser) diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc index 2d12697..fa69265 100644 --- a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc +++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc @@ -21,6 +21,7 @@ #include "chrome/common/net/gaia/gaia_urls.h" #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/net/gaia/oauth_request_signer.h" +#include "chrome/common/net/url_util.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/common/url_fetcher.h" @@ -685,7 +686,45 @@ void GaiaOAuthFetcher::OnURLFetchComplete(const content::URLFetcher* source) { true)) { OnOAuthRevokeTokenFetched(data, status, response_code); } else { - NOTREACHED(); + // Invalid cookies cause Gaia to redirect to ServiceLogin. Check if + // this is the case and report failure properly. + std::string url_no_query = url.GetOrigin().spec() + url.path().substr(1); + std::string continue_url; + if (url_no_query == gaia_urls->service_login_url() && + chrome_common_net::GetValueForKeyInQuery(url, "continue", + &continue_url)) { + LOG(ERROR) << "GaiaOAuthFetcher redirected to service login" + << " , url=" << url.spec(); + + if (StartsWithASCII(continue_url, + gaia_urls->get_oauth_token_url(), + true)) { + consumer_->OnGetOAuthTokenFailure(GoogleServiceAuthError( + GoogleServiceAuthError::SERVICE_UNAVAILABLE)); + } else if (continue_url == gaia_urls->oauth1_login_url()) { + consumer_->OnOAuthLoginFailure(GoogleServiceAuthError( + GoogleServiceAuthError::SERVICE_UNAVAILABLE)); + } else if (continue_url == gaia_urls->oauth_get_access_token_url()) { + consumer_->OnOAuthGetAccessTokenFailure(GoogleServiceAuthError( + GoogleServiceAuthError::SERVICE_UNAVAILABLE)); + } else if (continue_url == gaia_urls->oauth_wrap_bridge_url()) { + consumer_->OnOAuthWrapBridgeFailure(service_scope_, + GoogleServiceAuthError( + GoogleServiceAuthError::SERVICE_UNAVAILABLE)); + } else if (continue_url == gaia_urls->oauth_user_info_url()) { + consumer_->OnUserInfoFailure(GoogleServiceAuthError( + GoogleServiceAuthError::SERVICE_UNAVAILABLE)); + } else if (StartsWithASCII(continue_url, + gaia_urls->oauth_revoke_token_url(), + true)) { + consumer_->OnOAuthRevokeTokenFailure(GoogleServiceAuthError( + GoogleServiceAuthError::SERVICE_UNAVAILABLE)); + } else { + NOTREACHED(); + } + } else { + NOTREACHED() << "GaiaOAuthFetcher unknown url=" << url.spec(); + } } } diff --git a/chrome/browser/password_manager/login_database_unittest.cc b/chrome/browser/password_manager/login_database_unittest.cc index 2660c56..c879f0a 100644 --- a/chrome/browser/password_manager/login_database_unittest.cc +++ b/chrome/browser/password_manager/login_database_unittest.cc @@ -47,8 +47,8 @@ TEST_F(LoginDatabaseTest, Logins) { // Example password form. PasswordForm form; - form.origin = GURL("http://www.google.com/accounts/LoginAuth"); - form.action = GURL("http://www.google.com/accounts/Login"); + form.origin = GURL("http://accounts.google.com/LoginAuth"); + form.action = GURL("http://accounts.google.com/Login"); form.username_element = ASCIIToUTF16("Email"); form.username_value = ASCIIToUTF16("test@gmail.com"); form.password_element = ASCIIToUTF16("Passwd"); @@ -255,8 +255,8 @@ TEST_F(LoginDatabaseTest, BlacklistedLogins) { // Save a form as blacklisted. PasswordForm form; - form.origin = GURL("http://www.google.com/accounts/LoginAuth"); - form.action = GURL("http://www.google.com/accounts/Login"); + form.origin = GURL("http://accounts.google.com/LoginAuth"); + form.action = GURL("http://accounts.google.com/Login"); form.username_element = ASCIIToUTF16("Email"); form.password_element = ASCIIToUTF16("Passwd"); form.submit_element = ASCIIToUTF16("signIn"); diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc index 38cdf43..9398bf8 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc @@ -25,7 +25,7 @@ const char CloudPrintSetupSource::kInvalidPasswordHelpUrl[] = const char CloudPrintSetupSource::kCanNotAccessAccountUrl[] = "https://www.google.com/support/accounts/bin/answer.py?answer=48598"; const char CloudPrintSetupSource::kCreateNewAccountUrl[] = - "https://www.google.com/accounts/NewAccount?service=chromiumsync"; + "https://accounts.google.com/NewAccount?service=chromiumsync"; namespace { diff --git a/chrome/browser/printing/cloud_print/cloud_print_url.cc b/chrome/browser/printing/cloud_print/cloud_print_url.cc index b22880d..7a41028 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_url.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_url.cc @@ -16,7 +16,7 @@ const char kDefaultCloudPrintServiceURL[] = "https://www.google.com/cloudprint"; const char kDefaultCloudPrintSigninURL[] = - "https://www.google.com/accounts/ServiceLogin?" + "https://accounts.google.com/ServiceLogin?" "service=cloudprint&continue=https%3A%2F%2Fwww.google.com%2Fcloudprint"; const char kLearnMoreURL[] = diff --git a/chrome/browser/resources/chromeos/gaia_auth/manifest_test.json b/chrome/browser/resources/chromeos/gaia_auth/manifest_test.json index 774ed6e..356d95c 100644 --- a/chrome/browser/resources/chromeos/gaia_auth/manifest_test.json +++ b/chrome/browser/resources/chromeos/gaia_auth/manifest_test.json @@ -19,6 +19,7 @@ "permissions": [ "https://insecure.com/*", "https://www.google.com/accounts/*", + "https://accounts.google.com/*", "https://gaiastaging.corp.google.com/*", "chrome://oobe/" ] diff --git a/chrome/browser/resources/file_manager/js/directory_model.js b/chrome/browser/resources/file_manager/js/directory_model.js index 3098357..74390de 100644 --- a/chrome/browser/resources/file_manager/js/directory_model.js +++ b/chrome/browser/resources/file_manager/js/directory_model.js @@ -979,7 +979,7 @@ DirectoryModel.prototype.resolveRoots_ = function(callback, resolveGData) { } function onGDataError(error) { - console.log('GData error: ', error); + console.log('GData error: ' + error); self.unmountedGDataEntry_ = { unmounted: true, // Clients use this field to distinguish a fake root. toURL: function() { return '' }, diff --git a/chrome/browser/sync/resources/gaia_login_test.html b/chrome/browser/sync/resources/gaia_login_test.html index fe50af6..c3b5875 100644 --- a/chrome/browser/sync/resources/gaia_login_test.html +++ b/chrome/browser/sync/resources/gaia_login_test.html @@ -46,7 +46,7 @@ function set_up_testing() { return { error: get_selected_value(form.error), user: "homer@gmail.com", - captchaUrl: "https://www.google.com/accounts/Captcha" + captchaUrl: "https://accounts.google.com/Captcha" }; }; diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index f71c430..5467cff 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -63,10 +63,11 @@ const char kSyncServerCommandLine[] = "sync-server-command-line"; namespace { // The URLs for different calls in the Google Accounts programmatic login API. -const char kClientLoginUrl[] = "https://www.google.com/accounts/ClientLogin"; -const char kGetUserInfoUrl[] = "https://www.google.com/accounts/GetUserInfo"; +// TODO(rsimha): Use GaiaUrls here. +const char kClientLoginUrl[] = "https://accounts.google.com/ClientLogin"; +const char kGetUserInfoUrl[] = "https://accounts.google.com/GetUserInfo"; const char kIssueAuthTokenUrl[] = - "https://www.google.com/accounts/IssueAuthToken"; + "https://accounts.google.com/IssueAuthToken"; const char kSearchDomainCheckUrl[] = "https://www.google.com/searchdomaincheck?format=domain&type=chrome"; const char kOAuth2LoginTokenValidResponse[] = diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc index 8a5d073..e0516700 100644 --- a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc +++ b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc @@ -25,6 +25,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" +#include "chrome/common/net/url_util.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "googleurl/src/url_util.h" @@ -79,29 +80,6 @@ SyncPromoUIHTMLSource::SyncPromoUIHTMLSource(content::WebUI* web_ui) AddLocalizedStrings(localized_strings); } -// Looks for |search_key| in the query portion of |url|. Returns true if the -// key is found and sets |out_value| to the value for the key. Returns false if -// the key is not found. -bool GetValueForKeyInQuery(const GURL& url, const std::string& search_key, - std::string* out_value) { - url_parse::Component query = url.parsed_for_possibly_invalid_spec().query; - url_parse::Component key, value; - while (url_parse::ExtractQueryKeyValue( - url.spec().c_str(), &query, &key, &value)) { - if (key.is_nonempty()) { - std::string key_string = url.spec().substr(key.begin, key.len); - if (key_string == search_key) { - if (value.is_nonempty()) - *out_value = url.spec().substr(value.begin, value.len); - else - *out_value = ""; - return true; - } - } - } - return false; -} - } // namespace SyncPromoUI::SyncPromoUI(content::WebUI* web_ui) : WebUIController(web_ui) { @@ -247,12 +225,9 @@ GURL SyncPromoUI::GetSyncPromoURL(const GURL& next_page, Source source) { // static GURL SyncPromoUI::GetNextPageURLForSyncPromoURL(const GURL& url) { std::string value; - if (GetValueForKeyInQuery(url, kSyncPromoQueryKeyNextPage, &value)) { - url_canon::RawCanonOutputT<char16> output; - url_util::DecodeURLEscapeSequences(value.c_str(), value.length(), &output); - std::string url; - UTF16ToUTF8(output.data(), output.length(), &url); - return GURL(url); + if (chrome_common_net::GetValueForKeyInQuery( + url, kSyncPromoQueryKeyNextPage, &value)) { + return GURL(value); } return GURL(); } @@ -260,7 +235,8 @@ GURL SyncPromoUI::GetNextPageURLForSyncPromoURL(const GURL& url) { // static SyncPromoUI::Source SyncPromoUI::GetSourceForSyncPromoURL(const GURL& url) { std::string value; - if (GetValueForKeyInQuery(url, kSyncPromoQueryKeySource, &value)) { + if (chrome_common_net::GetValueForKeyInQuery( + url, kSyncPromoQueryKeySource, &value)) { int source = 0; if (base::StringToInt(value, &source) && source >= SOURCE_START_PAGE && source < SOURCE_UNKNOWN) { |