| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef COMPONENTS_SYNC_PREFERENCES_TESTING_PREF_SERVICE_SYNCABLE_H_ | 5 #ifndef COMPONENTS_SYNC_PREFERENCES_TESTING_PREF_SERVICE_SYNCABLE_H_ |
| 6 #define COMPONENTS_SYNC_PREFERENCES_TESTING_PREF_SERVICE_SYNCABLE_H_ | 6 #define COMPONENTS_SYNC_PREFERENCES_TESTING_PREF_SERVICE_SYNCABLE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/prefs/testing_pref_service.h" | 9 #include "components/prefs/testing_pref_service.h" |
| 10 #include "components/sync_preferences/pref_service_syncable.h" | 10 #include "components/sync_preferences/pref_service_syncable.h" |
| 11 | 11 |
| 12 namespace user_prefs { | 12 namespace user_prefs { |
| 13 class PrefRegistrySyncable; | 13 class PrefRegistrySyncable; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace sync_preferences { | 16 namespace sync_preferences { |
| 17 | 17 |
| 18 // Test version of PrefServiceSyncable. | 18 // Test version of PrefServiceSyncable. |
| 19 class TestingPrefServiceSyncable | 19 class TestingPrefServiceSyncable |
| 20 : public TestingPrefServiceBase<PrefServiceSyncable, | 20 : public TestingPrefServiceBase<PrefServiceSyncable, |
| 21 user_prefs::PrefRegistrySyncable> { | 21 user_prefs::PrefRegistrySyncable> { |
| 22 public: | 22 public: |
| 23 TestingPrefServiceSyncable(); | 23 TestingPrefServiceSyncable(); |
| 24 TestingPrefServiceSyncable(TestingPrefStore* managed_prefs, | 24 TestingPrefServiceSyncable(TestingPrefStore* managed_prefs, |
| 25 TestingPrefStore* extension_prefs, |
| 25 TestingPrefStore* user_prefs, | 26 TestingPrefStore* user_prefs, |
| 26 TestingPrefStore* recommended_prefs, | 27 TestingPrefStore* recommended_prefs, |
| 27 user_prefs::PrefRegistrySyncable* pref_registry, | 28 user_prefs::PrefRegistrySyncable* pref_registry, |
| 28 PrefNotifierImpl* pref_notifier); | 29 PrefNotifierImpl* pref_notifier); |
| 29 ~TestingPrefServiceSyncable() override; | 30 ~TestingPrefServiceSyncable() override; |
| 30 | 31 |
| 31 // This is provided as a convenience; on a production PrefService | 32 // This is provided as a convenience; on a production PrefService |
| 32 // you would do all registrations before constructing it, passing it | 33 // you would do all registrations before constructing it, passing it |
| 33 // a PrefRegistry via its constructor (or via e.g. PrefServiceFactory). | 34 // a PrefRegistry via its constructor (or via e.g. PrefServiceFactory). |
| 34 user_prefs::PrefRegistrySyncable* registry(); | 35 user_prefs::PrefRegistrySyncable* registry(); |
| 35 | 36 |
| 36 using PrefServiceSyncable::SetPrefModelAssociatorClientForTesting; | 37 using PrefServiceSyncable::SetPrefModelAssociatorClientForTesting; |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceSyncable); | 40 DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceSyncable); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace sync_preferences | 43 } // namespace sync_preferences |
| 43 | 44 |
| 44 template <> | 45 template <> |
| 45 TestingPrefServiceBase<sync_preferences::PrefServiceSyncable, | 46 TestingPrefServiceBase<sync_preferences::PrefServiceSyncable, |
| 46 user_prefs::PrefRegistrySyncable>:: | 47 user_prefs::PrefRegistrySyncable>:: |
| 47 TestingPrefServiceBase(TestingPrefStore* managed_prefs, | 48 TestingPrefServiceBase(TestingPrefStore* managed_prefs, |
| 49 TestingPrefStore* extension_prefs, |
| 48 TestingPrefStore* user_prefs, | 50 TestingPrefStore* user_prefs, |
| 49 TestingPrefStore* recommended_prefs, | 51 TestingPrefStore* recommended_prefs, |
| 50 user_prefs::PrefRegistrySyncable* pref_registry, | 52 user_prefs::PrefRegistrySyncable* pref_registry, |
| 51 PrefNotifierImpl* pref_notifier); | 53 PrefNotifierImpl* pref_notifier); |
| 52 | 54 |
| 53 #endif // COMPONENTS_SYNC_PREFERENCES_TESTING_PREF_SERVICE_SYNCABLE_H_ | 55 #endif // COMPONENTS_SYNC_PREFERENCES_TESTING_PREF_SERVICE_SYNCABLE_H_ |
| OLD | NEW |