diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 21:14:00 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 21:14:00 +0000 |
commit | e5f3d890194d0c8b02b7bd1d9cecbe4fafc648a4 (patch) | |
tree | 790568fd930dd50fc111d06c5feab8b77644daf0 | |
parent | 12180f88e55c3d3057187131cc5b62365ba67127 (diff) | |
download | chromium_src-e5f3d890194d0c8b02b7bd1d9cecbe4fafc648a4.zip chromium_src-e5f3d890194d0c8b02b7bd1d9cecbe4fafc648a4.tar.gz chromium_src-e5f3d890194d0c8b02b7bd1d9cecbe4fafc648a4.tar.bz2 |
Always use google_apis to get the client ID.
BUG=150042
Review URL: https://chromiumcodereview.appspot.com/11087057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161191 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | remoting/host/host_config.cc | 2 | ||||
-rw-r--r-- | remoting/host/host_config.h | 2 | ||||
-rw-r--r-- | remoting/host/remoting_me2me_host.cc | 28 | ||||
-rw-r--r-- | remoting/host/setup/host_starter.cc | 1 | ||||
-rwxr-xr-x | remoting/webapp/build-webapp.py | 5 | ||||
-rw-r--r-- | remoting/webapp/host_controller.js | 2 | ||||
-rw-r--r-- | remoting/webapp/jscompiler_hacks.js | 3 | ||||
-rw-r--r-- | remoting/webapp/plugin_settings.js | 7 |
8 files changed, 2 insertions, 48 deletions
diff --git a/remoting/host/host_config.cc b/remoting/host/host_config.cc index 869995f..96053e6 100644 --- a/remoting/host/host_config.cc +++ b/remoting/host/host_config.cc @@ -10,8 +10,6 @@ const char kHostEnabledConfigPath[] = "enabled"; const char kXmppLoginConfigPath[] = "xmpp_login"; const char kXmppAuthTokenConfigPath[] = "xmpp_auth_token"; const char kOAuthRefreshTokenConfigPath[] = "oauth_refresh_token"; -const char kOAuthUseOfficialClientIdConfigPath[] = - "oauth_use_official_client_id"; const char kXmppAuthServiceConfigPath[] = "xmpp_auth_service"; const char kHostIdConfigPath[] = "host_id"; const char kHostNameConfigPath[] = "host_name"; diff --git a/remoting/host/host_config.h b/remoting/host/host_config.h index ec8162c..e7d95f1 100644 --- a/remoting/host/host_config.h +++ b/remoting/host/host_config.h @@ -25,8 +25,6 @@ extern const char kXmppLoginConfigPath[]; extern const char kXmppAuthTokenConfigPath[]; // OAuth refresh token used to fetch an access token for the XMPP network. extern const char kOAuthRefreshTokenConfigPath[]; -// Flag to indicate whether the official client ID should be used. -extern const char kOAuthUseOfficialClientIdConfigPath[]; // Auth service used to authenticate to XMPP network. extern const char kXmppAuthServiceConfigPath[]; // Unique identifier of the host used to register the host in directory. diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index e012ff6..55bf298 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -119,11 +119,6 @@ class HostProcess explicit HostProcess(scoped_ptr<ChromotingHostContext> context) : context_(context.Pass()), config_(FilePath()), -#ifdef OFFICIAL_BUILD - oauth_use_official_client_id_(true), -#else - oauth_use_official_client_id_(false), -#endif allow_nat_traversal_(true), restarting_(false), shutting_down_(false), @@ -378,13 +373,6 @@ class HostProcess return false; } - // It is okay to not have this value and we will use the default value - // depending on whether this is an official build or not. - // If the client-Id type to use is not specified we default based on - // the build type. - config_.GetBoolean(kOAuthUseOfficialClientIdConfigPath, - &oauth_use_official_client_id_); - if (!oauth_refresh_token_.empty()) { xmpp_auth_token_ = ""; // This will be set to the access token later. xmpp_auth_service_ = "oauth2"; @@ -523,21 +511,10 @@ class HostProcess if (!oauth_refresh_token_.empty()) { OAuthClientInfo client_info = { - kUnofficialOAuth2ClientId, - kUnofficialOAuth2ClientSecret + google_apis::GetOAuth2ClientID(google_apis::CLIENT_REMOTING), + google_apis::GetOAuth2ClientSecret(google_apis::CLIENT_REMOTING) }; -#ifdef OFFICIAL_BUILD - if (oauth_use_official_client_id_) { - OAuthClientInfo official_client_info = { - google_apis::GetOAuth2ClientID(google_apis::CLIENT_REMOTING), - google_apis::GetOAuth2ClientSecret(google_apis::CLIENT_REMOTING) - }; - - client_info = official_client_info; - } -#endif // OFFICIAL_BUILD - scoped_ptr<SignalingConnector::OAuthCredentials> oauth_credentials( new SignalingConnector::OAuthCredentials( xmpp_login_, oauth_refresh_token_, client_info)); @@ -690,7 +667,6 @@ class HostProcess std::string xmpp_auth_service_; std::string oauth_refresh_token_; - bool oauth_use_official_client_id_; scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; bool allow_nat_traversal_; diff --git a/remoting/host/setup/host_starter.cc b/remoting/host/setup/host_starter.cc index cb631dc..31847fe 100644 --- a/remoting/host/setup/host_starter.cc +++ b/remoting/host/setup/host_starter.cc @@ -137,7 +137,6 @@ void HostStarter::OnHostRegistered() { scoped_ptr<base::DictionaryValue> config(new base::DictionaryValue()); config->SetString("xmpp_login", user_email_); config->SetString("oauth_refresh_token", refresh_token_); - config->SetBoolean("oauth_use_official_client_id", true); config->SetString("host_id", host_id_); config->SetString("host_name", host_name_); config->SetString("private_key", key_pair_.GetAsString()); diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py index d9ef472..5ac8f1f 100755 --- a/remoting/webapp/build-webapp.py +++ b/remoting/webapp/build-webapp.py @@ -194,8 +194,6 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin, # Set the correct API keys. apiClientId = google_api_keys.GetClientID('REMOTING') apiClientSecret = google_api_keys.GetClientSecret('REMOTING') - # TODO(jamiewalch): Get rid of the useOfficialClientId hack (crbug.com/150042) - oauth2UseOfficialClientId = 'true'; findAndReplace(os.path.join(destination, 'plugin_settings.js'), "'API_CLIENT_ID'", @@ -203,9 +201,6 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin, findAndReplace(os.path.join(destination, 'plugin_settings.js'), "'API_CLIENT_SECRET'", "'" + apiClientSecret + "'") - findAndReplace(os.path.join(destination, 'plugin_settings.js'), - "OAUTH2_USE_OFFICIAL_CLIENT_ID", - oauth2UseOfficialClientId) # Make the zipfile. createZip(zip_path, destination) diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js index 0aa7cc2..d8ac590 100644 --- a/remoting/webapp/host_controller.js +++ b/remoting/webapp/host_controller.js @@ -175,8 +175,6 @@ remoting.HostController.prototype.start = function(hostPin, consent, callback) { var hostConfig = JSON.stringify({ xmpp_login: remoting.oauth2.getCachedEmail(), oauth_refresh_token: remoting.oauth2.exportRefreshToken(), - oauth_use_official_client_id: - remoting.oauth2.USE_OFFICIAL_CLIENT_ID, host_id: newHostId, host_name: hostName, host_secret_hash: hostSecretHash, diff --git a/remoting/webapp/jscompiler_hacks.js b/remoting/webapp/jscompiler_hacks.js index ff6dddc..a377b7f 100644 --- a/remoting/webapp/jscompiler_hacks.js +++ b/remoting/webapp/jscompiler_hacks.js @@ -63,6 +63,3 @@ var WebKitMutationObserver = function(callback) {}; /** @param {Element} element @param {Object} options */ WebKitMutationObserver.prototype.observe = function(element, options) {}; - -// This string is replaced with the actual value in build-webapp.py. -var OAUTH2_USE_OFFICIAL_CLIENT_ID = false; diff --git a/remoting/webapp/plugin_settings.js b/remoting/webapp/plugin_settings.js index 0dc9126..d3fde9a 100644 --- a/remoting/webapp/plugin_settings.js +++ b/remoting/webapp/plugin_settings.js @@ -15,13 +15,6 @@ var remoting = remoting || {}; remoting.PLUGIN_MIMETYPE = 'HOST_PLUGIN_MIMETYPE'; /** - * @type {boolean} Flag that indicates whether official client ID should - * be used. - */ -remoting.OAuth2.prototype.USE_OFFICIAL_CLIENT_ID = - OAUTH2_USE_OFFICIAL_CLIENT_ID; - -/** * @type {string} The OAuth2 redirect URL. * @private */ |