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/logging.h" | 10 #include "base/logging.h" |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 SyncDirection direction) { | 557 SyncDirection direction) { |
558 FOR_EACH_OBSERVER( | 558 FOR_EACH_OBSERVER( |
559 SyncEventObserver, observers_, | 559 SyncEventObserver, observers_, |
560 OnFileSynced(url, sync_status, action_taken, direction)); | 560 OnFileSynced(url, sync_status, action_taken, direction)); |
561 } | 561 } |
562 | 562 |
563 void SyncFileSystemService::UpdateSyncEnabledStatus( | 563 void SyncFileSystemService::UpdateSyncEnabledStatus( |
564 ProfileSyncServiceBase* profile_sync_service) { | 564 ProfileSyncServiceBase* profile_sync_service) { |
565 if (!profile_sync_service->HasSyncSetupCompleted()) | 565 if (!profile_sync_service->HasSyncSetupCompleted()) |
566 return; | 566 return; |
567 sync_enabled_ = profile_sync_service->GetPreferredDataTypes().Has( | 567 sync_enabled_ = profile_sync_service->GetActiveDataTypes().Has( |
568 syncer::APPS); | 568 syncer::APPS); |
569 remote_file_service_->SetSyncEnabled(sync_enabled_); | 569 remote_file_service_->SetSyncEnabled(sync_enabled_); |
570 if (sync_enabled_) { | 570 if (sync_enabled_) { |
571 base::MessageLoopProxy::current()->PostTask( | 571 base::MessageLoopProxy::current()->PostTask( |
572 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 572 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
573 AsWeakPtr())); | 573 AsWeakPtr())); |
574 } | 574 } |
575 } | 575 } |
576 | 576 |
577 } // namespace sync_file_system | 577 } // namespace sync_file_system |
OLD | NEW |