| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Helper to initialize PrefService for cast shell. | 5 // Helper to initialize PrefService for cast shell. |
| 6 | 6 |
| 7 #ifndef CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_ | 7 #ifndef CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_ |
| 8 #define CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_ | 8 #define CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/prefs/pref_service.h" | |
| 16 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
| 17 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "components/prefs/pref_service.h" |
| 18 | 18 |
| 19 class PrefRegistrySimple; | 19 class PrefRegistrySimple; |
| 20 | 20 |
| 21 namespace chromecast { | 21 namespace chromecast { |
| 22 namespace shell { | 22 namespace shell { |
| 23 | 23 |
| 24 // It uses JsonPrefStore internally and/so the format of config file is same to | 24 // It uses JsonPrefStore internally and/so the format of config file is same to |
| 25 // that of JsonPrefStore. | 25 // that of JsonPrefStore. |
| 26 class PrefServiceHelper { | 26 class PrefServiceHelper { |
| 27 public: | 27 public: |
| 28 // Loads configs from config file. Returns true if successful. | 28 // Loads configs from config file. Returns true if successful. |
| 29 static scoped_ptr<PrefService> CreatePrefService( | 29 static scoped_ptr<PrefService> CreatePrefService( |
| 30 PrefRegistrySimple* registry); | 30 PrefRegistrySimple* registry); |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 // Registers any needed preferences for the current platform. | 33 // Registers any needed preferences for the current platform. |
| 34 static void RegisterPlatformPrefs(PrefRegistrySimple* registry); | 34 static void RegisterPlatformPrefs(PrefRegistrySimple* registry); |
| 35 | 35 |
| 36 // Called after the pref file has been loaded. | 36 // Called after the pref file has been loaded. |
| 37 static void OnPrefsLoaded(PrefService* pref_service); | 37 static void OnPrefsLoaded(PrefService* pref_service); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace shell | 40 } // namespace shell |
| 41 } // namespace chromecast | 41 } // namespace chromecast |
| 42 | 42 |
| 43 #endif // CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_ | 43 #endif // CHROMECAST_BROWSER_PREF_SERVICE_HELPER_H_ |
| OLD | NEW |