Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h

Issue 98803002: Dispatch FileStatus change events for LocalToRemote sync too (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/google_apis/gdata_errorcode.h" 11 #include "chrome/browser/google_apis/gdata_errorcode.h"
12 #include "chrome/browser/sync_file_system/file_change.h" 12 #include "chrome/browser/sync_file_system/file_change.h"
13 #include "chrome/browser/sync_file_system/sync_action.h"
13 #include "chrome/browser/sync_file_system/sync_callbacks.h" 14 #include "chrome/browser/sync_file_system/sync_callbacks.h"
14 #include "chrome/browser/sync_file_system/sync_file_metadata.h" 15 #include "chrome/browser/sync_file_system/sync_file_metadata.h"
15 #include "chrome/browser/sync_file_system/sync_task.h" 16 #include "chrome/browser/sync_file_system/sync_task.h"
16 17
17 namespace drive { 18 namespace drive {
18 class DriveServiceInterface; 19 class DriveServiceInterface;
19 class DriveUploaderInterface; 20 class DriveUploaderInterface;
20 } 21 }
21 22
22 namespace google_apis { 23 namespace google_apis {
(...skipping 13 matching lines...) Expand all
36 37
37 class LocalToRemoteSyncer : public SyncTask { 38 class LocalToRemoteSyncer : public SyncTask {
38 public: 39 public:
39 LocalToRemoteSyncer(SyncEngineContext* sync_context, 40 LocalToRemoteSyncer(SyncEngineContext* sync_context,
40 const FileChange& local_change, 41 const FileChange& local_change,
41 const base::FilePath& local_path, 42 const base::FilePath& local_path,
42 const fileapi::FileSystemURL& url); 43 const fileapi::FileSystemURL& url);
43 virtual ~LocalToRemoteSyncer(); 44 virtual ~LocalToRemoteSyncer();
44 virtual void Run(const SyncStatusCallback& callback) OVERRIDE; 45 virtual void Run(const SyncStatusCallback& callback) OVERRIDE;
45 46
47 const fileapi::FileSystemURL& url() const { return url_; }
48 const base::FilePath& target_path() const { return target_path_; }
49 SyncAction sync_action() const { return sync_action_; }
50
46 private: 51 private:
47 void SyncCompleted(const SyncStatusCallback& callback, 52 void SyncCompleted(const SyncStatusCallback& callback,
48 SyncStatusCode status); 53 SyncStatusCode status);
49 54
50 void HandleMissingRemoteFile(const SyncStatusCallback& callback); 55 void HandleMissingRemoteFile(const SyncStatusCallback& callback);
51 void HandleConflict(const SyncStatusCallback& callback); 56 void HandleConflict(const SyncStatusCallback& callback);
52 void HandleExistingRemoteFile(const SyncStatusCallback& callback); 57 void HandleExistingRemoteFile(const SyncStatusCallback& callback);
53 void HandleMissingParentCase(const SyncStatusCallback& callback); 58 void HandleMissingParentCase(const SyncStatusCallback& callback);
54 59
55 void DeleteRemoteFile(const SyncStatusCallback& callback); 60 void DeleteRemoteFile(const SyncStatusCallback& callback);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 bool IsContextReady(); 100 bool IsContextReady();
96 drive::DriveServiceInterface* drive_service(); 101 drive::DriveServiceInterface* drive_service();
97 drive::DriveUploaderInterface* drive_uploader(); 102 drive::DriveUploaderInterface* drive_uploader();
98 MetadataDatabase* metadata_database(); 103 MetadataDatabase* metadata_database();
99 104
100 SyncEngineContext* sync_context_; // Not owned. 105 SyncEngineContext* sync_context_; // Not owned.
101 106
102 FileChange local_change_; 107 FileChange local_change_;
103 base::FilePath local_path_; 108 base::FilePath local_path_;
104 fileapi::FileSystemURL url_; 109 fileapi::FileSystemURL url_;
110 SyncAction sync_action_;
105 111
106 scoped_ptr<FileTracker> remote_file_tracker_; 112 scoped_ptr<FileTracker> remote_file_tracker_;
107 scoped_ptr<FileTracker> remote_parent_folder_tracker_; 113 scoped_ptr<FileTracker> remote_parent_folder_tracker_;
108 base::FilePath target_path_; 114 base::FilePath target_path_;
109 115
110 base::WeakPtrFactory<LocalToRemoteSyncer> weak_ptr_factory_; 116 base::WeakPtrFactory<LocalToRemoteSyncer> weak_ptr_factory_;
111 117
112 DISALLOW_COPY_AND_ASSIGN(LocalToRemoteSyncer); 118 DISALLOW_COPY_AND_ASSIGN(LocalToRemoteSyncer);
113 }; 119 };
114 120
115 } // namespace drive_backend 121 } // namespace drive_backend
116 } // namespace sync_file_system 122 } // namespace sync_file_system
117 123
118 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_ H_ 124 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_ H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698