OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync_file_system/sync_file_system_service.h" | 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 | 791 |
792 RemoteFileSyncService* SyncFileSystemService::GetRemoteService( | 792 RemoteFileSyncService* SyncFileSystemService::GetRemoteService( |
793 const GURL& origin) { | 793 const GURL& origin) { |
794 if (IsV2Enabled()) | 794 if (IsV2Enabled()) |
795 return remote_service_.get(); | 795 return remote_service_.get(); |
796 if (!IsV2EnabledForOrigin(origin)) | 796 if (!IsV2EnabledForOrigin(origin)) |
797 return remote_service_.get(); | 797 return remote_service_.get(); |
798 | 798 |
799 if (!v2_remote_service_) { | 799 if (!v2_remote_service_) { |
800 v2_remote_service_ = RemoteFileSyncService::CreateForBrowserContext( | 800 v2_remote_service_ = RemoteFileSyncService::CreateForBrowserContext( |
801 RemoteFileSyncService::V2, profile_); | 801 RemoteFileSyncService::V2, profile_, &task_logger_); |
802 scoped_ptr<RemoteSyncRunner> v2_remote_syncer( | 802 scoped_ptr<RemoteSyncRunner> v2_remote_syncer( |
803 new RemoteSyncRunner(kRemoteSyncNameV2, this, | 803 new RemoteSyncRunner(kRemoteSyncNameV2, this, |
804 v2_remote_service_.get())); | 804 v2_remote_service_.get())); |
805 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); | 805 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); |
806 v2_remote_service_->AddFileStatusObserver(this); | 806 v2_remote_service_->AddFileStatusObserver(this); |
807 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); | 807 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); |
808 v2_remote_service_->SetSyncEnabled(sync_enabled_); | 808 v2_remote_service_->SetSyncEnabled(sync_enabled_); |
809 remote_sync_runners_.push_back(v2_remote_syncer.release()); | 809 remote_sync_runners_.push_back(v2_remote_syncer.release()); |
810 } | 810 } |
811 return v2_remote_service_.get(); | 811 return v2_remote_service_.get(); |
812 } | 812 } |
813 | 813 |
814 } // namespace sync_file_system | 814 } // namespace sync_file_system |
OLD | NEW |