summaryrefslogtreecommitdiffstats
path: root/chrome/service/cloud_print
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-06 02:18:47 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-06 02:18:47 +0000
commite5e894fffe16b1969b9f19c11308d15d09012648 (patch)
treeca329548140e81925e50e38cce477c12036df381 /chrome/service/cloud_print
parent63b4659295df79538043587868f96106caeed0ff (diff)
downloadchromium_src-e5e894fffe16b1969b9f19c11308d15d09012648.zip
chromium_src-e5e894fffe16b1969b9f19c11308d15d09012648.tar.gz
chromium_src-e5e894fffe16b1969b9f19c11308d15d09012648.tar.bz2
Add an API to retrieve the keys that services should use for Google APIs.
This tightens up the DEPS for chrome/common/net/gaia so that it depends on none of Chrome, and the same is true for the new chrome/common/net/google_apis. The intent is to make it reusable by components outside of chrome/, such as remoting/, but it would be nice to follow up with a move to a better location for sharing. This change switches Cloud Print, Remoting, and any user of GaiaClient to using keys via the new API. It does not however change any of the key values or the way they are provided (although it does introduce means of overriding them). Follow-up work will make it easy to specify the keys via include.gypi or chromium.gyp_env, and add baking-in of keys for some build types. BUG=145584 TEST=Any service that requires log-in could be affected by this, e.g. Cloud Print, Chromoting, and sync. The change should have no impact on these services; in particular you should not need to log in again after you update to a build with this change if you were previously logged in. Review URL: https://chromiumcodereview.appspot.com/10889044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/cloud_print')
-rw-r--r--chrome/service/cloud_print/cloud_print_consts.cc4
-rw-r--r--chrome/service/cloud_print/cloud_print_consts.h2
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy.cc7
3 files changed, 5 insertions, 8 deletions
diff --git a/chrome/service/cloud_print/cloud_print_consts.cc b/chrome/service/cloud_print/cloud_print_consts.cc
index 5818edd..a0f90bf 100644
--- a/chrome/service/cloud_print/cloud_print_consts.cc
+++ b/chrome/service/cloud_print/cloud_print_consts.cc
@@ -55,7 +55,3 @@ const char kPrintSystemFailedMessageId[] = "printsystemfail";
const char kGetPrinterCapsFailedMessageId[] = "getprncapsfail";
const char kEnumPrintersFailedMessageId[] = "enumfail";
const char kZombiePrinterMessageId[] = "zombieprinter";
-
-const char kDefaultCloudPrintOAuthClientId[] =
- "551556820943.apps.googleusercontent.com";
-const char kDefaultCloudPrintOAuthClientSecret[] = "u3/mp8CgLFxh4uiX1855/MHe";
diff --git a/chrome/service/cloud_print/cloud_print_consts.h b/chrome/service/cloud_print/cloud_print_consts.h
index d91238a..c709f88 100644
--- a/chrome/service/cloud_print/cloud_print_consts.h
+++ b/chrome/service/cloud_print/cloud_print_consts.h
@@ -46,8 +46,6 @@ extern const char kPrintSystemFailedMessageId[];
extern const char kGetPrinterCapsFailedMessageId[];
extern const char kEnumPrintersFailedMessageId[];
extern const char kZombiePrinterMessageId[];
-extern const char kDefaultCloudPrintOAuthClientId[];
-extern const char kDefaultCloudPrintOAuthClientSecret[];
// Max retry count for job data fetch requests.
const int kJobDataMaxRetryCount = 5;
diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc
index 808ffbf..581103a 100644
--- a/chrome/service/cloud_print/cloud_print_proxy.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy.cc
@@ -12,6 +12,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/cloud_print/cloud_print_proxy_info.h"
#include "chrome/common/net/gaia/gaia_oauth_client.h"
+#include "chrome/common/net/google_apis/google_api_keys.h"
#include "chrome/common/pref_names.h"
#include "chrome/service/cloud_print/cloud_print_consts.h"
#include "chrome/service/cloud_print/print_system.h"
@@ -172,8 +173,10 @@ bool CloudPrintProxy::CreateBackend() {
// TODO(sanjeevr): Allow overriding OAuthClientInfo in prefs.
gaia::OAuthClientInfo oauth_client_info;
- oauth_client_info.client_id = kDefaultCloudPrintOAuthClientId;
- oauth_client_info.client_secret = kDefaultCloudPrintOAuthClientSecret;
+ oauth_client_info.client_id =
+ google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT);
+ oauth_client_info.client_secret =
+ google_apis::GetOAuth2ClientSecret(google_apis::CLIENT_CLOUD_PRINT);
cloud_print_server_url_ = GURL(cloud_print_server_url_str.c_str());
DCHECK(cloud_print_server_url_.is_valid());