blob: 2718899383c230130e470d813486a0de6adde973 [file] [log] [blame]
byungchulba8252562014-12-05 21:01:271// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// Helper to initialize PrefService for cast shell.
6
derekjchowe54ff592016-01-06 01:05:507#ifndef CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_
8#define CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_
byungchulba8252562014-12-05 21:01:279
dcheng3c3c93d52016-04-08 05:12:3110#include <memory>
Ken MacKay3beca952021-04-21 18:41:0211#include <set>
derekjchowe54ff592016-01-06 01:05:5012#include <string>
13
14#include "base/files/file_path.h"
15#include "base/memory/ref_counted.h"
derekjchowe54ff592016-01-06 01:05:5016#include "base/threading/thread_checker.h"
brettw066508682016-02-03 08:22:0217#include "components/prefs/pref_service.h"
byungchulba8252562014-12-05 21:01:2718
19class PrefRegistrySimple;
20
21namespace chromecast {
derekjchowe54ff592016-01-06 01:05:5022namespace shell {
byungchulba8252562014-12-05 21:01:2723
24// It uses JsonPrefStore internally and/so the format of config file is same to
25// that of JsonPrefStore.
26class PrefServiceHelper {
27 public:
28 // Loads configs from config file. Returns true if successful.
dcheng3c3c93d52016-04-08 05:12:3129 static std::unique_ptr<PrefService> CreatePrefService(
derekjchowe54ff592016-01-06 01:05:5030 PrefRegistrySimple* registry);
byungchulba8252562014-12-05 21:01:2731
Ken MacKay3beca952021-04-21 18:41:0232 // Provides names of prefs that take a large amount of storage, and are
33 // therefore stored in a different file.
34 static std::set<std::string> LargePrefNames() __attribute__((weak));
35
byungchulba8252562014-12-05 21:01:2736 private:
37 // Registers any needed preferences for the current platform.
38 static void RegisterPlatformPrefs(PrefRegistrySimple* registry);
39
40 // Called after the pref file has been loaded.
41 static void OnPrefsLoaded(PrefService* pref_service);
42};
43
derekjchowe54ff592016-01-06 01:05:5044} // namespace shell
byungchulba8252562014-12-05 21:01:2745} // namespace chromecast
46
derekjchowe54ff592016-01-06 01:05:5047#endif // CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_