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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 10116040: Remoting daemon process to support unofficial client ID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed comments Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
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..18e55ecb2b35039366022cfdb9a2e87b0ccc21b3 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -67,6 +67,16 @@ const FilePath::CharType kDefaultHostConfigFile[] =
const int kMinPortNumber = 12400;
const int kMaxPortNumber = 12409;
+const remoting::OAuthClientInfo kUnofficialOAuth2ClientInfo = {
+ "440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj.apps.googleusercontent.com",
+ "W2ieEsG-R1gIA4MMurGrgMc_"
+};
+
+const remoting::OAuthClientInfo kOfficialOAuth2ClientInfo = {
+ "440925447803-avn2sj1kc099s0r7v62je5s339mu0am1.apps.googleusercontent.com",
+ "Bgur6DFiOMM1h8x-AQpuTQlK"
+};
+
} // namespace
namespace remoting {
@@ -76,6 +86,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 +255,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.
Wez 2012/04/20 22:29:46 nit: Suggest "If the client-Id type to use is not
+ auth_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";
@@ -288,9 +308,17 @@ class HostProcess
new SignalingConnector(signal_strategy_.get()));
if (!oauth_refresh_token_.empty()) {
+ OAuthClientInfo client_info = kUnofficialOAuth2ClientInfo;
+
+#ifdef OFFICIAL_BUILD
+ if (oauth_use_official_client_id_) {
+ client_info = kOfficialOAuth2ClientInfo;
+ }
+#endif // OFFICIAL_BUILD
+
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 +401,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_;

Powered by Google App Engine
This is Rietveld 408576698