Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / chromecast / browser / pref_service_helper.h
blobcf41a925f36695895133a21733460a1f9a9aa6c9
1 // 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.
7 #ifndef CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_
8 #define CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_
10 #include <string>
12 #include "base/files/file_path.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/prefs/pref_service.h"
16 #include "base/threading/sequenced_worker_pool.h"
17 #include "base/threading/thread_checker.h"
19 class PrefRegistrySimple;
21 namespace chromecast {
22 namespace shell {
24 // It uses JsonPrefStore internally and/so the format of config file is same to
25 // that of JsonPrefStore.
26 class PrefServiceHelper {
27 public:
28 // Loads configs from config file. Returns true if successful.
29 static scoped_ptr<PrefService> CreatePrefService(
30 PrefRegistrySimple* registry);
32 private:
33 // Registers any needed preferences for the current platform.
34 static void RegisterPlatformPrefs(PrefRegistrySimple* registry);
36 // Called after the pref file has been loaded.
37 static void OnPrefsLoaded(PrefService* pref_service);
40 } // namespace shell
41 } // namespace chromecast
43 #endif // CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_