- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync_file_system / drive_backend / uninstall_app_task.h
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.
4
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_
7
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"
14
15 namespace drive {
16 class DriveServiceInterface;
17 }
18
19 namespace google_apis {
20 class ResourceEntry;
21 class ResourceList;
22 }
23
24 namespace sync_file_system {
25 namespace drive_backend {
26
27 class FileTracker;
28 class MetadataDatabase;
29 class SyncEngineContext;
30 class TrackerSet;
31
32 class UninstallAppTask : public SyncTask {
33  public:
34   typedef RemoteFileSyncService::UninstallFlag UninstallFlag;
35   UninstallAppTask(SyncEngineContext* sync_context,
36                    const std::string& app_id,
37                    UninstallFlag uninstall_flag);
38   virtual ~UninstallAppTask();
39
40   virtual void Run(const SyncStatusCallback& callback) OVERRIDE;
41
42  private:
43   void DidDeleteAppRoot(const SyncStatusCallback& callback,
44                         int64 change_id,
45                         google_apis::GDataErrorCode error);
46
47   MetadataDatabase* metadata_database();
48   drive::DriveServiceInterface* drive_service();
49
50   SyncEngineContext* sync_context_;  // Not owned.
51
52   std::string app_id_;
53   UninstallFlag uninstall_flag_;
54   int64 app_root_tracker_id_;
55
56   base::WeakPtrFactory<UninstallAppTask> weak_ptr_factory_;
57
58   DISALLOW_COPY_AND_ASSIGN(UninstallAppTask);
59 };
60
61 }  // namespace drive_backend
62 }  // namespace sync_file_system
63
64 #endif  // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_UNINSTALL_APP_TASK_H_