Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chrome / browser / sync_file_system / drive_backend / uninstall_app_task.h
blob3e73899e3b5745a22a429bee4f90bcf7f73b94f9
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_UNINSTALL_APP_TASK_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_UNINSTALL_APP_TASK_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h"
13 #include "chrome/browser/sync_file_system/remote_file_sync_service.h"
14 #include "chrome/browser/sync_file_system/sync_callbacks.h"
15 #include "google_apis/drive/gdata_errorcode.h"
17 namespace drive {
18 class DriveServiceInterface;
21 namespace google_apis {
22 class ResourceEntry;
23 class ResourceList;
26 namespace sync_file_system {
27 namespace drive_backend {
29 class FileTracker;
30 class MetadataDatabase;
31 class SyncEngineContext;
32 class TrackerSet;
34 class UninstallAppTask : public ExclusiveTask {
35 public:
36 typedef RemoteFileSyncService::UninstallFlag UninstallFlag;
37 UninstallAppTask(SyncEngineContext* sync_context,
38 const std::string& app_id,
39 UninstallFlag uninstall_flag);
40 virtual ~UninstallAppTask();
42 virtual void RunExclusive(const SyncStatusCallback& callback) OVERRIDE;
44 private:
45 void DidDeleteAppRoot(const SyncStatusCallback& callback,
46 int64 change_id,
47 google_apis::GDataErrorCode error);
49 bool IsContextReady();
50 MetadataDatabase* metadata_database();
51 drive::DriveServiceInterface* drive_service();
53 SyncEngineContext* sync_context_; // Not owned.
55 std::string app_id_;
56 UninstallFlag uninstall_flag_;
57 int64 app_root_tracker_id_;
59 base::WeakPtrFactory<UninstallAppTask> weak_ptr_factory_;
61 DISALLOW_COPY_AND_ASSIGN(UninstallAppTask);
64 } // namespace drive_backend
65 } // namespace sync_file_system
67 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_UNINSTALL_APP_TASK_H_