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

Unified Diff: chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc

Issue 7497069: Support Sync following Gaia OAuth authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean-up Created 9 years, 4 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: chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc
diff --git a/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc b/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc
index 3ba02b44b1958bed7b9ce816f03b5091a6c96e80..0ab1244884624498b476cf33a63d60b4ec899fd4 100644
--- a/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc
+++ b/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc
@@ -4,9 +4,11 @@
#include "chrome/browser/sync/engine/net/syncapi_server_connection_manager.h"
+#include "base/command_line.h"
akalin 2011/08/11 21:49:14 remove this include (and include oauth.h)
Rick Campbell 2011/08/12 09:02:02 Done.
#include "chrome/browser/sync/engine/http_post_provider_factory.h"
#include "chrome/browser/sync/engine/http_post_provider_interface.h"
#include "chrome/browser/sync/engine/syncapi.h"
+#include "chrome/common/chrome_switches.h"
akalin 2011/08/11 21:49:14 remove this include (and include oauth.h)
Rick Campbell 2011/08/12 09:02:02 Done.
#include "chrome/common/net/http_return.h"
using browser_sync::HttpResponse;
@@ -36,7 +38,13 @@ bool SyncAPIBridgedPost::Init(const char* path,
http->SetURL(connection_url.c_str(), sync_server_port);
if (!auth_token.empty()) {
- std::string headers = "Authorization: GoogleLogin auth=" + auth_token;
+ std::string headers;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
akalin 2011/08/11 21:49:14 use IsUsingOAuth here. Or maybe decomp this into
Rick Campbell 2011/08/12 09:02:02 Done. Also fixed one other stray use of kEnableSy
+ switches::kEnableSyncOAuth)) {
+ headers = "Authorization: OAuth " + auth_token;
+ } else {
+ headers = "Authorization: GoogleLogin auth=" + auth_token;
+ }
http->SetExtraRequestHeaders(headers.c_str());
}

Powered by Google App Engine
This is Rietveld 408576698