blob: 1546cc84428a5dcfc97b791d79db7a9ba765616d [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
derekjchowe54ff592016-01-06 01:05:5010#include <string>
11
12#include "base/files/file_path.h"
13#include "base/memory/ref_counted.h"
byungchulba8252562014-12-05 21:01:2714#include "base/memory/scoped_ptr.h"
derekjchowe54ff592016-01-06 01:05:5015#include "base/threading/sequenced_worker_pool.h"
16#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.
29 static scoped_ptr<PrefService> CreatePrefService(
derekjchowe54ff592016-01-06 01:05:5030 PrefRegistrySimple* registry);
byungchulba8252562014-12-05 21:01:2731
32 private:
33 // Registers any needed preferences for the current platform.
34 static void RegisterPlatformPrefs(PrefRegistrySimple* registry);
35
36 // Called after the pref file has been loaded.
37 static void OnPrefsLoaded(PrefService* pref_service);
38};
39
derekjchowe54ff592016-01-06 01:05:5040} // namespace shell
byungchulba8252562014-12-05 21:01:2741} // namespace chromecast
42
derekjchowe54ff592016-01-06 01:05:5043#endif // CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_