Index: remoting/host/remoting_me2me_host.cc |
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
index 3812854f15c18a02e54d63737f7051768aa0cd7c..1d5bff3ed91fae788cdfe2aa60bee840604b8671 100644 |
--- a/remoting/host/remoting_me2me_host.cc |
+++ b/remoting/host/remoting_me2me_host.cc |
@@ -76,6 +76,11 @@ class HostProcess |
public: |
HostProcess() |
: message_loop_(MessageLoop::TYPE_UI), |
+#ifdef OFFICIAL_BUILD |
+ oauth_use_official_client_id_(true), |
+#else |
+ oauth_use_official_client_id_(false), |
+#endif |
allow_nat_traversal_(true), |
restarting_(false), |
exit_code_(kSuccessExitCode) { |
@@ -240,6 +245,11 @@ 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. |
+ auth_config.GetBoolean(kOAuthUseOfficialClientIdPath, |
+ &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"; |
@@ -288,9 +298,29 @@ class HostProcess |
new SignalingConnector(signal_strategy_.get())); |
if (!oauth_refresh_token_.empty()) { |
+ OAuthClientInfo client_info; |
+ OAuthClientInfo unofficial_client_info = { |
+ "440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj" |
+ ".apps.googleusercontent.com", |
+ "W2ieEsG-R1gIA4MMurGrgMc_" |
Wez
2012/04/19 00:13:04
Could this and the official info be a static const
Alpha Left Google
2012/04/20 22:13:50
Done.
|
+ }; |
+ |
+#ifdef OFFICIAL_BUILD |
+ OAuthClientInfo official_client_info = { |
+ "440925447803-avn2sj1kc099s0r7v62je5s339mu0am1" |
+ ".apps.googleusercontent.com", |
+ "Bgur6DFiOMM1h8x-AQpuTQlK" |
+ }; |
+ |
+ if (oauth_use_official_client_id_) |
+ client_info = official_client_info; |
Sergey Ulanov
2012/04/19 01:57:32
need {} here
Alpha Left Google
2012/04/20 22:13:50
Now the #ifdef block is much simpler and {} is not
|
+ else |
+#endif // OFFICIAL_BUILD |
+ client_info = unofficial_client_info; |
Wez
2012/04/19 00:13:04
If you move this above the #ifdef block then you d
Alpha Left Google
2012/04/20 22:13:50
Done.
|
+ |
scoped_ptr<SignalingConnector::OAuthCredentials> oauth_credentials( |
new SignalingConnector::OAuthCredentials( |
- xmpp_login_, oauth_refresh_token_)); |
+ xmpp_login_, oauth_refresh_token_, client_info)); |
signaling_connector_->EnableOAuth( |
oauth_credentials.Pass(), |
base::Bind(&HostProcess::OnOAuthFailed, base::Unretained(this)), |
@@ -373,6 +403,7 @@ class HostProcess |
std::string xmpp_auth_service_; |
std::string oauth_refresh_token_; |
+ bool oauth_use_official_client_id_; |
scoped_ptr<policy_hack::NatPolicy> nat_policy_; |
bool allow_nat_traversal_; |