Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: chrome/common/net/gaia/gaia_urls.cc

Issue 10443024: Added chrome switch that lets tests override URL path, moved GAIA auth extension from CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/net/gaia/gaia_urls.h" 5 #include "chrome/common/net/gaia/gaia_urls.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 9
10 namespace { 10 namespace {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 CommandLine* command_line = CommandLine::ForCurrentProcess(); 56 CommandLine* command_line = CommandLine::ForCurrentProcess();
57 std::string host_base; 57 std::string host_base;
58 if (command_line->HasSwitch(switches::kGaiaHost)) { 58 if (command_line->HasSwitch(switches::kGaiaHost)) {
59 host_base = command_line->GetSwitchValueASCII(switches::kGaiaHost); 59 host_base = command_line->GetSwitchValueASCII(switches::kGaiaHost);
60 } else { 60 } else {
61 host_base = kDefaultGaiaBaseUrl; 61 host_base = kDefaultGaiaBaseUrl;
62 } 62 }
63 63
64 captcha_url_prefix_ = "http://" + host_base + kCaptchaUrlPrefixSuffix; 64 captcha_url_prefix_ = "http://" + host_base + kCaptchaUrlPrefixSuffix;
65 gaia_origin_url_ = "https://" + host_base; 65 gaia_origin_url_ = "https://" + host_base;
66 if (command_line->HasSwitch(switches::kGaiaUrlPath)) {
67 std::string path = command_line->GetSwitchValueASCII(switches::kGaiaUrlPath) ;
68 if (!path.empty()) {
69 if (path[0] != '/')
70 gaia_origin_url_.append("/");
71
72 gaia_origin_url_.append(path);
73 }
74 }
75
66 client_login_url_ = gaia_origin_url_ + kClientLoginUrlSuffix; 76 client_login_url_ = gaia_origin_url_ + kClientLoginUrlSuffix;
67 service_login_url_ = gaia_origin_url_ + kServiceLoginUrlSuffix; 77 service_login_url_ = gaia_origin_url_ + kServiceLoginUrlSuffix;
68 issue_auth_token_url_ = gaia_origin_url_ + kIssueAuthTokenUrlSuffix; 78 issue_auth_token_url_ = gaia_origin_url_ + kIssueAuthTokenUrlSuffix;
69 get_user_info_url_ = gaia_origin_url_ + kGetUserInfoUrlSuffix; 79 get_user_info_url_ = gaia_origin_url_ + kGetUserInfoUrlSuffix;
70 token_auth_url_ = gaia_origin_url_ + kTokenAuthUrlSuffix; 80 token_auth_url_ = gaia_origin_url_ + kTokenAuthUrlSuffix;
71 merge_session_url_ = gaia_origin_url_ + kMergeSessionUrlSuffix; 81 merge_session_url_ = gaia_origin_url_ + kMergeSessionUrlSuffix;
72 82
73 // Federated login is not part of Gaia and has its own endpoints. 83 // Federated login is not part of Gaia and has its own endpoints.
74 get_oauth_token_url_ = std::string(kDefaultFederatedLoginBaseUrl) + 84 get_oauth_token_url_ = std::string(kDefaultFederatedLoginBaseUrl) +
75 kGetOAuthTokenUrlSuffix; 85 kGetOAuthTokenUrlSuffix;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 197 }
188 198
189 const std::string& GaiaUrls::oauth2_issue_token_url() { 199 const std::string& GaiaUrls::oauth2_issue_token_url() {
190 return oauth2_issue_token_url_; 200 return oauth2_issue_token_url_;
191 } 201 }
192 202
193 203
194 const std::string& GaiaUrls::gaia_login_form_realm() { 204 const std::string& GaiaUrls::gaia_login_form_realm() {
195 return gaia_login_form_realm_; 205 return gaia_login_form_realm_;
196 } 206 }
OLDNEW
« chrome/browser/resources/gaia_auth/success.js ('K') | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698