blob: 013e92aabf2577db921fe09dd4a18b22e2cf8566 [file]
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_UPDATER_REMOVE_UNINSTALLED_APPS_TASK_H_
#define CHROME_UPDATER_REMOVE_UNINSTALLED_APPS_TASK_H_
#include <string>
#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "base/sequence_checker.h"
#include "chrome/updater/updater_scope.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace base {
class FilePath;
} // namespace base
namespace update_client {
class UpdateClient;
enum class Error;
} // namespace update_client
namespace updater {
class Configurator;
class PersistedData;
class RemoveUninstalledAppsTask
: public base::RefCountedThreadSafe<RemoveUninstalledAppsTask> {
public:
RemoveUninstalledAppsTask(scoped_refptr<Configurator> config,
UpdaterScope scope);
void Run(base::OnceClosure callback);
private:
friend class base::RefCountedThreadSafe<RemoveUninstalledAppsTask>;
virtual ~RemoveUninstalledAppsTask();
absl::optional<int> GetUnregisterReason(const std::string& app_id,
const base::FilePath& ecp) const;
SEQUENCE_CHECKER(sequence_checker_);
scoped_refptr<Configurator> config_;
scoped_refptr<PersistedData> persisted_data_;
scoped_refptr<update_client::UpdateClient> update_client_;
UpdaterScope scope_;
};
} // namespace updater
#endif // CHROME_UPDATER_REMOVE_UNINSTALLED_APPS_TASK_H_