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 "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/google_apis/gdata_errorcode.h"
11 #include "chrome/browser/sync_file_system/remote_file_sync_service.h"
12 #include "chrome/browser/sync_file_system/sync_callbacks.h"
13 #include "chrome/browser/sync_file_system/sync_task.h"
16 class DriveServiceInterface;
19 namespace google_apis {
24 namespace sync_file_system {
25 namespace drive_backend {
28 class MetadataDatabase;
29 class SyncEngineContext;
32 class UninstallAppTask : public SyncTask {
34 typedef RemoteFileSyncService::UninstallFlag UninstallFlag;
35 UninstallAppTask(SyncEngineContext* sync_context,
36 const std::string& app_id,
37 UninstallFlag uninstall_flag);
38 virtual ~UninstallAppTask();
40 virtual void Run(const SyncStatusCallback& callback) OVERRIDE;
43 void DidDeleteAppRoot(const SyncStatusCallback& callback,
45 google_apis::GDataErrorCode error);
47 MetadataDatabase* metadata_database();
48 drive::DriveServiceInterface* drive_service();
50 SyncEngineContext* sync_context_; // Not owned.
53 UninstallFlag uninstall_flag_;
54 int64 app_root_tracker_id_;
56 base::WeakPtrFactory<UninstallAppTask> weak_ptr_factory_;
58 DISALLOW_COPY_AND_ASSIGN(UninstallAppTask);
61 } // namespace drive_backend
62 } // namespace sync_file_system
64 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_UNINSTALL_APP_TASK_H_