1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_
8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/sync_file_system/remote_change_processor.h"
11 namespace sync_file_system {
12 namespace drive_backend {
14 // This class wraps a part of RemoteChangeProcessor class to support weak
15 // pointer. Each method wraps corresponding name method of
16 // RemoteChangeProcessor. See comments in remote_change_processor.h
18 class RemoteChangeProcessorWrapper
19 : public base::SupportsWeakPtr<RemoteChangeProcessorWrapper> {
21 explicit RemoteChangeProcessorWrapper(
22 RemoteChangeProcessor* remote_change_processor);
24 void PrepareForProcessRemoteChange(
25 const fileapi::FileSystemURL& url,
26 const RemoteChangeProcessor::PrepareChangeCallback& callback);
28 void ApplyRemoteChange(
29 const FileChange& change,
30 const base::FilePath& local_path,
31 const fileapi::FileSystemURL& url,
32 const SyncStatusCallback& callback);
34 void FinalizeRemoteSync(
35 const fileapi::FileSystemURL& url,
36 bool clear_local_changes,
37 const base::Closure& completion_callback);
39 void RecordFakeLocalChange(
40 const fileapi::FileSystemURL& url,
41 const FileChange& change,
42 const SyncStatusCallback& callback);
45 RemoteChangeProcessor* remote_change_processor_;
47 DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessorWrapper);
50 } // namespace drive_backend
51 } // namespace sync_file_system
53 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_