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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/sync_file_system/sync_callbacks.h"
14 #include "google_apis/drive/gdata_errorcode.h"
17 class DriveServiceInterface;
20 namespace google_apis {
26 namespace sync_file_system {
27 namespace drive_backend {
29 class MetadataDatabase;
30 class SyncEngineContext;
34 typedef base::Callback<void(const std::string& file_id,
35 SyncStatusCode status)> FileIDCallback;
37 FolderCreator(drive::DriveServiceInterface* drive_service,
38 MetadataDatabase* metadata_database,
39 const std::string& parent_folder_id,
40 const std::string& title);
43 void Run(const FileIDCallback& callback);
46 void DidCreateFolder(const FileIDCallback& callback,
47 google_apis::GDataErrorCode error,
48 scoped_ptr<google_apis::FileResource> entry);
49 void DidListFolders(const FileIDCallback& callback,
50 ScopedVector<google_apis::FileResource> candidates,
51 google_apis::GDataErrorCode error,
52 scoped_ptr<google_apis::FileList> file_list);
54 drive::DriveServiceInterface* drive_service_;
55 MetadataDatabase* metadata_database_;
57 const std::string parent_folder_id_;
58 const std::string title_;
60 base::WeakPtrFactory<FolderCreator> weak_ptr_factory_;
62 DISALLOW_COPY_AND_ASSIGN(FolderCreator);
65 } // namespace drive_backend
66 } // namespace sync_file_system
68 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_FOLDER_CREATOR_H_