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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 9 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 class FilePath; | 12 class FilePath; |
13 class SequencedTaskRunner; | 13 class SequencedTaskRunner; |
14 class Time; | 14 class Time; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
(...skipping 15 matching lines...) Expand all Loading... |
32 class CopyOperation; | 32 class CopyOperation; |
33 class CreateDirectoryOperation; | 33 class CreateDirectoryOperation; |
34 class CreateFileOperation; | 34 class CreateFileOperation; |
35 class MoveOperation; | 35 class MoveOperation; |
36 class OperationObserver; | 36 class OperationObserver; |
37 class RemoveOperation; | 37 class RemoveOperation; |
38 class SearchOperation; | 38 class SearchOperation; |
39 class TouchOperation; | 39 class TouchOperation; |
40 class UpdateOperation; | 40 class UpdateOperation; |
41 | 41 |
42 // Callback for DriveOperations::Search. | 42 // Callback for Operations::Search. |
43 // On success, |error| is FILE_ERROR_OK, and remaining arguments are valid to | 43 // On success, |error| is FILE_ERROR_OK, and remaining arguments are valid to |
44 // use. | 44 // use. |
45 // |next_feed| is the URL to fetch the remaining result from the server. Maybe | 45 // |next_feed| is the URL to fetch the remaining result from the server. Maybe |
46 // empty if there is no more results. | 46 // empty if there is no more results. |
47 // On error, |error| is set to other than FILE_ERROR_OK, and the caller | 47 // On error, |error| is set to other than FILE_ERROR_OK, and the caller |
48 // shouldn't use remaining arguments. | 48 // shouldn't use remaining arguments. |
49 typedef base::Callback<void(FileError error, | 49 typedef base::Callback<void(FileError error, |
50 const GURL& next_feed, | 50 const GURL& next_feed, |
51 scoped_ptr<std::vector<SearchResultInfo> > result)> | 51 scoped_ptr<std::vector<SearchResultInfo> > result)> |
52 SearchOperationCallback; | 52 SearchOperationCallback; |
53 | 53 |
54 // Passes notifications from Drive operations back to the file system. | 54 // This class is just a bundle of file system operation handlers which |
55 class DriveOperations { | 55 // perform the actual operations. The class is introduced to make it easy to |
| 56 // initialize the operation handlers. |
| 57 class Operations { |
56 public: | 58 public: |
57 DriveOperations(); | 59 Operations(); |
58 ~DriveOperations(); | 60 ~Operations(); |
59 | 61 |
60 // Allocates the operation objects and initializes the operation pointers. | 62 // Allocates the operation objects and initializes the operation pointers. |
61 void Init(OperationObserver* observer, | 63 void Init(OperationObserver* observer, |
62 JobScheduler* scheduler, | 64 JobScheduler* scheduler, |
63 internal::ResourceMetadata* metadata, | 65 internal::ResourceMetadata* metadata, |
64 internal::FileCache* cache, | 66 internal::FileCache* cache, |
65 FileSystemInterface* file_system, | 67 FileSystemInterface* file_system, |
66 google_apis::DriveServiceInterface* drive_service, | 68 google_apis::DriveServiceInterface* drive_service, |
67 base::SequencedTaskRunner* blocking_task_runner); | 69 base::SequencedTaskRunner* blocking_task_runner); |
68 | 70 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 scoped_ptr<MoveOperation> move_operation_; | 138 scoped_ptr<MoveOperation> move_operation_; |
137 scoped_ptr<RemoveOperation> remove_operation_; | 139 scoped_ptr<RemoveOperation> remove_operation_; |
138 scoped_ptr<TouchOperation> touch_operation_; | 140 scoped_ptr<TouchOperation> touch_operation_; |
139 scoped_ptr<UpdateOperation> update_operation_; | 141 scoped_ptr<UpdateOperation> update_operation_; |
140 scoped_ptr<SearchOperation> search_operation_; | 142 scoped_ptr<SearchOperation> search_operation_; |
141 }; | 143 }; |
142 | 144 |
143 } // namespace file_system | 145 } // namespace file_system |
144 } // namespace drive | 146 } // namespace drive |
145 | 147 |
146 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_DRIVE_OPERATIONS_H_ | 148 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATIONS_H_ |
OLD | NEW |