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

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

Issue 305913002: drive: Replace GetResourceListCallback in DriveServiceInterface with FileListCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 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_FOLDER_CREATOR_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/sync_file_system/sync_callbacks.h" 13 #include "chrome/browser/sync_file_system/sync_callbacks.h"
14 #include "google_apis/drive/gdata_errorcode.h" 14 #include "google_apis/drive/gdata_errorcode.h"
15 15
16 namespace drive { 16 namespace drive {
17 class DriveServiceInterface; 17 class DriveServiceInterface;
18 } 18 }
19 19
20 namespace google_apis { 20 namespace google_apis {
21 class FileList;
22 class FileResource;
21 class ResourceEntry; 23 class ResourceEntry;
22 class ResourceList;
23 } 24 }
24 25
25 namespace sync_file_system { 26 namespace sync_file_system {
26 namespace drive_backend { 27 namespace drive_backend {
27 28
28 class MetadataDatabase; 29 class MetadataDatabase;
29 class SyncEngineContext; 30 class SyncEngineContext;
30 31
31 class FolderCreator { 32 class FolderCreator {
32 public: 33 public:
33 typedef base::Callback<void(const std::string& file_id, 34 typedef base::Callback<void(const std::string& file_id,
34 SyncStatusCode status)> FileIDCallback; 35 SyncStatusCode status)> FileIDCallback;
35 36
36 FolderCreator(drive::DriveServiceInterface* drive_service, 37 FolderCreator(drive::DriveServiceInterface* drive_service,
37 MetadataDatabase* metadata_database, 38 MetadataDatabase* metadata_database,
38 const std::string& parent_folder_id, 39 const std::string& parent_folder_id,
39 const std::string& title); 40 const std::string& title);
40 ~FolderCreator(); 41 ~FolderCreator();
41 42
42 void Run(const FileIDCallback& callback); 43 void Run(const FileIDCallback& callback);
43 44
44 private: 45 private:
45 void DidCreateFolder(const FileIDCallback& callback, 46 void DidCreateFolder(const FileIDCallback& callback,
46 google_apis::GDataErrorCode error, 47 google_apis::GDataErrorCode error,
47 scoped_ptr<google_apis::ResourceEntry> entry); 48 scoped_ptr<google_apis::ResourceEntry> entry);
48 void DidListFolders(const FileIDCallback& callback, 49 void DidListFolders(const FileIDCallback& callback,
49 ScopedVector<google_apis::ResourceEntry> candidates, 50 ScopedVector<google_apis::FileResource> candidates,
50 google_apis::GDataErrorCode error, 51 google_apis::GDataErrorCode error,
51 scoped_ptr<google_apis::ResourceList> resource_list); 52 scoped_ptr<google_apis::FileList> file_list);
52 void DidUpdateDatabase(const std::string& file_id, 53 void DidUpdateDatabase(const std::string& file_id,
53 const FileIDCallback& callback, 54 const FileIDCallback& callback,
54 SyncStatusCode status); 55 SyncStatusCode status);
55 56
56 drive::DriveServiceInterface* drive_service_; 57 drive::DriveServiceInterface* drive_service_;
57 MetadataDatabase* metadata_database_; 58 MetadataDatabase* metadata_database_;
58 59
59 const std::string parent_folder_id_; 60 const std::string parent_folder_id_;
60 const std::string title_; 61 const std::string title_;
61 62
62 base::WeakPtrFactory<FolderCreator> weak_ptr_factory_; 63 base::WeakPtrFactory<FolderCreator> weak_ptr_factory_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(FolderCreator); 65 DISALLOW_COPY_AND_ASSIGN(FolderCreator);
65 }; 66 };
66 67
67 } // namespace drive_backend 68 } // namespace drive_backend
68 } // namespace sync_file_system 69 } // namespace sync_file_system
69 70
70 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_ 71 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698