blob: 4bb5ec19b494e7b1d96aaf5ce2063a5cc8fa7c4d [file] [log] [blame]
// Copyright 2019 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 "components/games/core/games_prefs.h"
namespace games {
namespace prefs {
namespace {
const char kGamesInstallDirPref[] = "games.data_files_paths";
} // namespace
void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterFilePathPref(kGamesInstallDirPref, base::FilePath());
}
void SetInstallDirPath(PrefService* prefs, const base::FilePath& file_path) {
prefs->SetFilePath(kGamesInstallDirPref, file_path);
}
bool TryGetInstallDirPath(PrefService* prefs, base::FilePath* out_file_path) {
*out_file_path = prefs->GetFilePath(kGamesInstallDirPref);
return !out_file_path->empty();
}
} // namespace prefs
} // namespace games