chromium/chrome/browser/ash/crosapi/browser_data_migrator.h

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_ASH_CROSAPI_BROWSER_DATA_MIGRATOR_H_
#define CHROME_BROWSER_ASH_CROSAPI_BROWSER_DATA_MIGRATOR_H_

#include <memory>
#include <optional>

#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/functional/callback.h"
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/sequence_checker.h"
#include "chrome/browser/ash/crosapi/browser_data_migrator_util.h"
#include "chrome/browser/ash/crosapi/browser_util.h"
#include "components/account_id/account_id.h"

class PrefService;
class PrefRegistrySimple;

namespace ash {

namespace standalone_browser {
class MigrationProgressTracker;

namespace migrator_util {
enum class PolicyInitState;
}  // namespace migrator_util

}  // namespace standalone_browser

// Local state pref name, which is used to keep track of what step migration is
// at. This ensures that ash does not get restarted repeatedly for migration.
// 1. The user logs in and restarts ash if necessary to apply flags.
// 2. Migration check runs.
// 3. Restart ash to run migration.
// 4. Restart ash again to show the home screen.
constexpr char kMigrationStep[] =;

// Injects the restart function called from
// `BrowserDataMigratorImpl::AttemptRestart()` in RAII manner.
class ScopedRestartAttemptForTesting {};

// The interface is exposed to be inherited by fakes in tests.
class BrowserDataMigrator {};

// BrowserDataMigratorImpl is responsible for one time browser data migration
// from ash-chrome to lacros-chrome. It is responsible for coordination the
// overrall flow of the migration from checking whether migration is required to
// marking migration as completed. The actual task of migration (i.e. setting up
// the profile directories for ash and lacros) is delegated to
// `MigratorDelegate`.
class BrowserDataMigratorImpl : public BrowserDataMigrator {};

}  // namespace ash
#endif  // CHROME_BROWSER_ASH_CROSAPI_BROWSER_DATA_MIGRATOR_H_