blob: 4fa8d97fac568a920d2a4942f7d154f191faf744 [file] [log] [blame]
// Copyright 2018 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.
#include <string>
#include "base/command_line.h"
#include "components/chrome_cleaner/public/constants/constants.h"
namespace chrome_cleaner {
// This class is used as a wrapper around the OS calls related to reboot.
class RebooterAPI {
virtual ~RebooterAPI() {}
// Add command line switches to be added to the post reboot run.
virtual void AppendPostRebootSwitch(const std::string& switch_string) = 0;
virtual void AppendPostRebootSwitchASCII(const std::string& switch_string,
const std::string& value) = 0;
// Register the currently running executable to run once after the reboot
// with the post reboot command line switch. Return false on failure.
// |cleanup_id| will be added to the post reboot command line.
// |execution_mode| should be the currently running executable's execution
// mode.
virtual bool RegisterPostRebootRun(
const base::CommandLine* current_command_line,
const std::string& cleanup_id,
ExecutionMode execution_mode,
bool logs_uploads_allowed) = 0;
// Remove the entries to run Chrome Cleanup after reboot.
virtual void UnregisterPostRebootRun() = 0;
} // namespace chrome_cleaner