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

Side by Side Diff: chrome/browser/chromeos/drive/file_system/remove_operation.h

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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
OLDNEW
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_REMOVE_OPERATION_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" 11 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
12 #include "chrome/browser/google_apis/gdata_errorcode.h" 12 #include "chrome/browser/google_apis/gdata_errorcode.h"
13 13
14 class GURL;
15
16 namespace base {
14 class FilePath; 17 class FilePath;
15 class GURL; 18 }
16 19
17 namespace google_apis { 20 namespace google_apis {
18 } 21 }
19 22
20 namespace drive { 23 namespace drive {
21 24
22 class DriveCache; 25 class DriveCache;
23 class DriveEntryProto; 26 class DriveEntryProto;
24 class DriveFileSystem; 27 class DriveFileSystem;
25 class DriveScheduler; 28 class DriveScheduler;
26 29
27 namespace file_system { 30 namespace file_system {
28 31
29 class OperationObserver; 32 class OperationObserver;
30 33
31 // This class encapsulates the drive Remove function. It is responsible for 34 // This class encapsulates the drive Remove function. It is responsible for
32 // sending the request to the drive API, then updating the local state and 35 // sending the request to the drive API, then updating the local state and
33 // metadata to reflect the new state. 36 // metadata to reflect the new state.
34 class RemoveOperation { 37 class RemoveOperation {
35 public: 38 public:
36 RemoveOperation(DriveScheduler* drive_scheduler, 39 RemoveOperation(DriveScheduler* drive_scheduler,
37 DriveCache* cache, 40 DriveCache* cache,
38 DriveResourceMetadata* metadata, 41 DriveResourceMetadata* metadata,
39 OperationObserver* observer); 42 OperationObserver* observer);
40 virtual ~RemoveOperation(); 43 virtual ~RemoveOperation();
41 44
42 // Perform the remove operation on the file at drive path |file_path|. 45 // Perform the remove operation on the file at drive path |file_path|.
43 // Invokes |callback| when finished with the result of the operation. 46 // Invokes |callback| when finished with the result of the operation.
44 // |callback| must not be null. 47 // |callback| must not be null.
45 virtual void Remove(const FilePath& file_path, 48 virtual void Remove(const base::FilePath& file_path,
46 bool is_recursive, 49 bool is_recursive,
47 const FileOperationCallback& callback); 50 const FileOperationCallback& callback);
48 51
49 private: 52 private:
50 // Part of Remove(). Called after GetEntryInfoByPath() is complete. 53 // Part of Remove(). Called after GetEntryInfoByPath() is complete.
51 // |callback| must not be null. 54 // |callback| must not be null.
52 void RemoveAfterGetEntryInfo( 55 void RemoveAfterGetEntryInfo(
53 const FileOperationCallback& callback, 56 const FileOperationCallback& callback,
54 DriveFileError error, 57 DriveFileError error,
55 scoped_ptr<DriveEntryProto> entry_proto); 58 scoped_ptr<DriveEntryProto> entry_proto);
56 59
57 // Callback for DriveServiceInterface::DeleteResource. Removes the entry with 60 // Callback for DriveServiceInterface::DeleteResource. Removes the entry with
58 // |resource_id| from the local snapshot of the filesystem and the cache. 61 // |resource_id| from the local snapshot of the filesystem and the cache.
59 // |callback| must not be null. 62 // |callback| must not be null.
60 void RemoveResourceLocally( 63 void RemoveResourceLocally(
61 const FileOperationCallback& callback, 64 const FileOperationCallback& callback,
62 const std::string& resource_id, 65 const std::string& resource_id,
63 google_apis::GDataErrorCode status); 66 google_apis::GDataErrorCode status);
64 67
65 // Sends notification for directory changes. Notifies of directory changes, 68 // Sends notification for directory changes. Notifies of directory changes,
66 // and runs |callback| with |error|. |callback| must not be null. 69 // and runs |callback| with |error|. |callback| must not be null.
67 void NotifyDirectoryChanged( 70 void NotifyDirectoryChanged(
68 const FileOperationCallback& callback, 71 const FileOperationCallback& callback,
69 DriveFileError error, 72 DriveFileError error,
70 const FilePath& directory_path); 73 const base::FilePath& directory_path);
71 74
72 DriveScheduler* drive_scheduler_; 75 DriveScheduler* drive_scheduler_;
73 DriveCache* cache_; 76 DriveCache* cache_;
74 DriveResourceMetadata* metadata_; 77 DriveResourceMetadata* metadata_;
75 OperationObserver* observer_; 78 OperationObserver* observer_;
76 79
77 // WeakPtrFactory bound to the UI thread. 80 // WeakPtrFactory bound to the UI thread.
78 // Note: This should remain the last member so it'll be destroyed and 81 // Note: This should remain the last member so it'll be destroyed and
79 // invalidate the weak pointers before any other members are destroyed. 82 // invalidate the weak pointers before any other members are destroyed.
80 base::WeakPtrFactory<RemoveOperation> weak_ptr_factory_; 83 base::WeakPtrFactory<RemoveOperation> weak_ptr_factory_;
81 84
82 DISALLOW_COPY_AND_ASSIGN(RemoveOperation); 85 DISALLOW_COPY_AND_ASSIGN(RemoveOperation);
83 }; 86 };
84 87
85 } // namespace file_system 88 } // namespace file_system
86 } // namespace drive 89 } // namespace drive
87 90
88 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_ 91 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_REMOVE_OPERATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698