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

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: Incorporating code review comments from Roger. 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..2916a4b526bfebe739f4733ed53bc5fc4b210aaa 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,12 @@
#include "chrome/browser/sync/engine/net/syncapi_server_connection_manager.h"
+#include "base/command_line.h"
#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/sync_setup_wizard.h"
tim (not reviewing) 2011/08/10 19:39:36 Although we don't have a DEPS rule enforcing this,
Rick Campbell 2011/08/11 03:58:23 Done. Eliminated SyncSetupWizard::IsUsingOAuth()
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/http_return.h"
using browser_sync::HttpResponse;
@@ -36,7 +39,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 (SyncSetupWizard::IsUsingOAuth()) {
+ 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