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

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: Final review comments 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
« no previous file with comments | « chrome/browser/net/gaia/token_service.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b05c52558e7bb8b2f889d17ba2f329500de85ac9 100644
--- a/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc
+++ b/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc
@@ -7,6 +7,7 @@
#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/browser/sync/util/oauth.h"
#include "chrome/common/net/http_return.h"
using browser_sync::HttpResponse;
@@ -36,7 +37,12 @@ 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 (browser_sync::IsUsingOAuth()) {
+ headers = "Authorization: OAuth " + auth_token;
+ } else {
+ headers = "Authorization: GoogleLogin auth=" + auth_token;
+ }
http->SetExtraRequestHeaders(headers.c_str());
}
« no previous file with comments | « chrome/browser/net/gaia/token_service.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698