| 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/mock_remote_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/mock_remote_file_sync_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/location.h" | 10 #include "base/location.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 void MockRemoteFileSyncService::NotifyRemoteServiceStateUpdated( | 57 void MockRemoteFileSyncService::NotifyRemoteServiceStateUpdated( |
| 58 RemoteServiceState state, | 58 RemoteServiceState state, |
| 59 const std::string& description) { | 59 const std::string& description) { |
| 60 FOR_EACH_OBSERVER(Observer, service_observers_, | 60 FOR_EACH_OBSERVER(Observer, service_observers_, |
| 61 OnRemoteServiceStateUpdated(state, description)); | 61 OnRemoteServiceStateUpdated(state, description)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void MockRemoteFileSyncService::NotifyFileStatusChanged( | 64 void MockRemoteFileSyncService::NotifyFileStatusChanged( |
| 65 const fileapi::FileSystemURL& url, | 65 const fileapi::FileSystemURL& url, |
| 66 fileapi::SyncFileStatus sync_status, | 66 SyncFileStatus sync_status, |
| 67 fileapi::SyncAction action_taken, | 67 SyncAction action_taken, |
| 68 fileapi::SyncDirection direction) { | 68 SyncDirection direction) { |
| 69 FOR_EACH_OBSERVER(FileStatusObserver, file_status_observers_, | 69 FOR_EACH_OBSERVER(FileStatusObserver, file_status_observers_, |
| 70 OnFileStatusChanged(url, sync_status, | 70 OnFileStatusChanged(url, sync_status, |
| 71 action_taken, direction)); | 71 action_taken, direction)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void MockRemoteFileSyncService::AddServiceObserverStub(Observer* observer) { | 74 void MockRemoteFileSyncService::AddServiceObserverStub(Observer* observer) { |
| 75 service_observers_.AddObserver(observer); | 75 service_observers_.AddObserver(observer); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void MockRemoteFileSyncService::AddFileStatusObserverStub( | 78 void MockRemoteFileSyncService::AddFileStatusObserverStub( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 FROM_HERE, | 114 FROM_HERE, |
| 115 base::Bind(callback, fileapi::SYNC_FILE_ERROR_NOT_FOUND, | 115 base::Bind(callback, fileapi::SYNC_FILE_ERROR_NOT_FOUND, |
| 116 fileapi::SyncFileMetadata())); | 116 fileapi::SyncFileMetadata())); |
| 117 return; | 117 return; |
| 118 } | 118 } |
| 119 base::MessageLoopProxy::current()->PostTask( | 119 base::MessageLoopProxy::current()->PostTask( |
| 120 FROM_HERE, base::Bind(callback, fileapi::SYNC_STATUS_OK, iter->second)); | 120 FROM_HERE, base::Bind(callback, fileapi::SYNC_STATUS_OK, iter->second)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace sync_file_system | 123 } // namespace sync_file_system |
| OLD | NEW |