| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/local/canned_syncable_file_system.h" | 5 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <iterator> | 8 #include <iterator> | 
| 9 | 9 | 
| 10 #include "base/bind.h" | 10 #include "base/bind.h" | 
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 543 | 543 | 
| 544 SyncFileSystemBackend* CannedSyncableFileSystem::backend() { | 544 SyncFileSystemBackend* CannedSyncableFileSystem::backend() { | 
| 545   return SyncFileSystemBackend::GetBackend(file_system_context_.get()); | 545   return SyncFileSystemBackend::GetBackend(file_system_context_.get()); | 
| 546 } | 546 } | 
| 547 | 547 | 
| 548 FileSystemOperationRunner* CannedSyncableFileSystem::operation_runner() { | 548 FileSystemOperationRunner* CannedSyncableFileSystem::operation_runner() { | 
| 549   return file_system_context_->operation_runner(); | 549   return file_system_context_->operation_runner(); | 
| 550 } | 550 } | 
| 551 | 551 | 
| 552 void CannedSyncableFileSystem::OnSyncEnabled(const FileSystemURL& url) { | 552 void CannedSyncableFileSystem::OnSyncEnabled(const FileSystemURL& url) { | 
| 553   sync_status_observers_->Notify(&LocalFileSyncStatus::Observer::OnSyncEnabled, | 553   sync_status_observers_->Notify( | 
| 554                                  url); | 554       FROM_HERE, &LocalFileSyncStatus::Observer::OnSyncEnabled, url); | 
| 555 } | 555 } | 
| 556 | 556 | 
| 557 void CannedSyncableFileSystem::OnWriteEnabled(const FileSystemURL& url) { | 557 void CannedSyncableFileSystem::OnWriteEnabled(const FileSystemURL& url) { | 
| 558   sync_status_observers_->Notify(&LocalFileSyncStatus::Observer::OnWriteEnabled, | 558   sync_status_observers_->Notify( | 
| 559                                  url); | 559       FROM_HERE, &LocalFileSyncStatus::Observer::OnWriteEnabled, url); | 
| 560 } | 560 } | 
| 561 | 561 | 
| 562 void CannedSyncableFileSystem::DoOpenFileSystem( | 562 void CannedSyncableFileSystem::DoOpenFileSystem( | 
| 563     const OpenFileSystemCallback& callback) { | 563     const OpenFileSystemCallback& callback) { | 
| 564   EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); | 564   EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); | 
| 565   EXPECT_FALSE(is_filesystem_opened_); | 565   EXPECT_FALSE(is_filesystem_opened_); | 
| 566   file_system_context_->OpenFileSystem( | 566   file_system_context_->OpenFileSystem( | 
| 567       origin_, | 567       origin_, | 
| 568       type_, | 568       type_, | 
| 569       storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 569       storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 757   sync_status_ = status; | 757   sync_status_ = status; | 
| 758   quit_closure.Run(); | 758   quit_closure.Run(); | 
| 759 } | 759 } | 
| 760 | 760 | 
| 761 void CannedSyncableFileSystem::InitializeSyncStatusObserver() { | 761 void CannedSyncableFileSystem::InitializeSyncStatusObserver() { | 
| 762   ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); | 762   ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); | 
| 763   backend()->sync_context()->sync_status()->AddObserver(this); | 763   backend()->sync_context()->sync_status()->AddObserver(this); | 
| 764 } | 764 } | 
| 765 | 765 | 
| 766 }  // namespace sync_file_system | 766 }  // namespace sync_file_system | 
| OLD | NEW | 
|---|