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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 150003004: Replace PO2TS::GetPrimaryAccountId() with SMB::GetAuthenticatedAccountId. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 10 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_file_system/drive_backend/sync_engine.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
index 6f687d76f5b779538a527f9f2898e853b478ab20..e2a54e8dd8fa1ccca5d355f20d029344ea5605b6 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -19,6 +19,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/profile_oauth2_token_service.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chrome/browser/signin/signin_manager.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h"
#include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h"
#include "chrome/browser/sync_file_system/drive_backend/list_changes_task.h"
@@ -64,9 +66,11 @@ scoped_ptr<SyncEngine> SyncEngine::CreateForBrowserContext(
worker_pool->GetSequenceToken(),
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
+ Profile* profile = Profile::FromBrowserContext(context);
ProfileOAuth2TokenService* token_service =
- ProfileOAuth2TokenServiceFactory::GetForProfile(
- Profile::FromBrowserContext(context));
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(profile);
scoped_ptr<drive::DriveServiceInterface> drive_service(
new drive::DriveAPIService(
token_service,
@@ -74,7 +78,7 @@ scoped_ptr<SyncEngine> SyncEngine::CreateForBrowserContext(
drive_task_runner.get(),
base_drive_url, base_download_url, wapi_base_url,
std::string() /* custom_user_agent */));
- drive_service->Initialize(token_service->GetPrimaryAccountId());
+ drive_service->Initialize(signin_manager->GetAuthenticatedAccountId());
scoped_ptr<drive::DriveUploaderInterface> drive_uploader(
new drive::DriveUploader(drive_service.get(), drive_task_runner.get()));
@@ -348,7 +352,9 @@ void SyncEngine::OnReadyToSendRequests() {
UpdateServiceState(REMOTE_SERVICE_OK, "Authenticated");
if (!metadata_database_ && auth_token_service_) {
- drive_service_->Initialize(auth_token_service_->GetPrimaryAccountId());
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(auth_token_service_->profile());
Joao da Silva 2014/02/10 20:31:34 nit: indent
Roger Tawa OOO till Jul 10th 2014/02/10 21:10:07 Done.
+ drive_service_->Initialize(signin_manager->GetAuthenticatedAccountId());
PostInitializeTask();
return;
}
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync_file_system/drive_backend_v1/api_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698