Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync_file_system / drive_backend / register_app_task.h
blobcea580f2c9cd8b79a6415bfae7cf2fa7fcf3b67d
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_REGISTER_APP_TASK_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REGISTER_APP_TASK_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/sync_file_system/sync_callbacks.h"
11 #include "chrome/browser/sync_file_system/sync_task.h"
12 #include "google_apis/drive/gdata_errorcode.h"
14 namespace drive {
15 class DriveServiceInterface;
18 namespace google_apis {
19 class ResourceEntry;
20 class ResourceList;
23 namespace sync_file_system {
24 namespace drive_backend {
26 class FileTracker;
27 class FolderCreator;
28 class MetadataDatabase;
29 class SyncEngineContext;
30 class TrackerSet;
32 class RegisterAppTask : public SyncTask {
33 public:
34 RegisterAppTask(SyncEngineContext* sync_context, const std::string& app_id);
35 virtual ~RegisterAppTask();
37 virtual void Run(const SyncStatusCallback& callback) OVERRIDE;
39 private:
40 void CreateAppRootFolder(const SyncStatusCallback& callback);
41 void DidCreateAppRootFolder(const SyncStatusCallback& callback,
42 const std::string& file_id,
43 SyncStatusCode status);
44 bool FilterCandidates(const TrackerSet& trackers,
45 FileTracker* candidate);
46 void RegisterAppIntoDatabase(const FileTracker& tracker,
47 const SyncStatusCallback& callback);
49 MetadataDatabase* metadata_database();
50 drive::DriveServiceInterface* drive_service();
52 SyncEngineContext* sync_context_; // Not owned.
54 int create_folder_retry_count_;
55 std::string app_id_;
57 scoped_ptr<FolderCreator> folder_creator_;
59 base::WeakPtrFactory<RegisterAppTask> weak_ptr_factory_;
61 DISALLOW_COPY_AND_ASSIGN(RegisterAppTask);
64 } // namespace drive_backend
65 } // namespace sync_file_system
67 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REGISTER_APP_TASK_H_