blob: 29dd3d27bb523fcde52ab205c987b3357824ddc8 [file] [log] [blame]
// Copyright 2018 The Chromium OS 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 "oobe_config/load_oobe_config_interface.h"
#include <memory>
#include <string>
#include <base/files/file_path.h>
#include "oobe_config/metrics.h"
namespace oobe_config {
class OobeConfig;
class RollbackData;
// An object of this class has the responsibility of loading the oobe config
// file after rollback.
class LoadOobeConfigRollback : public LoadOobeConfigInterface {
LoadOobeConfigRollback(OobeConfig* oobe_config, bool allow_unencrypted);
LoadOobeConfigRollback(const LoadOobeConfigRollback&) = delete;
LoadOobeConfigRollback& operator=(const LoadOobeConfigRollback&) = delete;
~LoadOobeConfigRollback() = default;
bool GetOobeConfigJson(std::string* config,
std::string* enrollment_domain) override;
// Assembles a JSON config for Chrome based on rollback_data. Returns true if
// |config| is successfully populated during stage 3 of rollback. Returns
// false to indicate that either rollback was not attempted or there was a
// failure. During stage 1 of rollback, the process exits before returning.
bool AssembleConfig(const RollbackData& rollback_data, std::string* config);
OobeConfig* oobe_config_;
bool allow_unencrypted_ = false;
Metrics metrics_; // For UMA metrics logging.
} // namespace oobe_config