Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / sync_file_system / drive_backend / uninstall_app_task.h
blob2b9e0d732f02d819f725563893955c52229570b7
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/drive_api_error_codes.h"
17 namespace drive {
18 class DriveServiceInterface;
21 namespace sync_file_system {
22 namespace drive_backend {
24 class FileTracker;
25 class MetadataDatabase;
26 class SyncEngineContext;
27 class TrackerSet;
29 class UninstallAppTask : public ExclusiveTask {
30 public:
31 typedef RemoteFileSyncService::UninstallFlag UninstallFlag;
32 UninstallAppTask(SyncEngineContext* sync_context,
33 const std::string& app_id,
34 UninstallFlag uninstall_flag);
35 ~UninstallAppTask() override;
37 void RunExclusive(const SyncStatusCallback& callback) override;
39 private:
40 void DidDeleteAppRoot(const SyncStatusCallback& callback,
41 int64 change_id,
42 google_apis::DriveApiErrorCode error);
44 bool IsContextReady();
45 MetadataDatabase* metadata_database();
46 drive::DriveServiceInterface* drive_service();
48 SyncEngineContext* sync_context_; // Not owned.
50 std::string app_id_;
51 UninstallFlag uninstall_flag_;
52 int64 app_root_tracker_id_;
54 base::WeakPtrFactory<UninstallAppTask> weak_ptr_factory_;
56 DISALLOW_COPY_AND_ASSIGN(UninstallAppTask);
59 } // namespace drive_backend
60 } // namespace sync_file_system
62 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_UNINSTALL_APP_TASK_H_