Index: chrome/browser/prefs/pref_value_store.h |
diff --git a/chrome/browser/prefs/pref_value_store.h b/chrome/browser/prefs/pref_value_store.h |
index fec16b4315b7351f2d2039d61cfbb47ef7c348d4..071cddcf67f35061a0021e1a4c1e2dae166d32d6 100644 |
--- a/chrome/browser/prefs/pref_value_store.h |
+++ b/chrome/browser/prefs/pref_value_store.h |
@@ -14,7 +14,6 @@ |
#include "base/callback.h" |
#include "base/gtest_prod_util.h" |
#include "base/ref_counted.h" |
-#include "base/scoped_ptr.h" |
#include "base/values.h" |
#include "chrome/browser/browser_thread.h" |
#include "chrome/common/notification_observer.h" |
@@ -77,26 +76,13 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore>, |
Profile* profile); |
virtual ~PrefValueStore(); |
- // Gets the value for the given preference name that has a valid value type; |
- // that is, the same type the preference was registered with, or NULL for |
- // default values of Dictionaries and Lists. Returns true if a valid value |
- // was found in any of the available PrefStores. Most callers should use |
- // Preference::GetValue() instead of calling this method directly. |
- bool GetValue(const std::string& name, Value** out_value) const; |
- |
- // Adds a preference to the mapping of names to types. |
- void RegisterPreferenceType(const std::string& name, Value::ValueType type); |
- |
- // Gets the registered value type for the given preference name. Returns |
- // Value::TYPE_NULL if the preference has never been registered. |
- Value::ValueType GetRegisteredType(const std::string& name) const; |
- |
- // Returns true if the PrefValueStore contains the given preference (i.e., |
- // it's been registered), and a value with the correct type has been actively |
- // set in some pref store. The application default specified when the pref was |
- // registered does not count as an "actively set" value, but another pref |
- // store setting a value that happens to be equal to the default does. |
- bool HasPrefPath(const char* name) const; |
+ // Gets the value for the given preference name that has the specified value |
+ // type. Returns true if a valid value was found in any of the available |
+ // PrefStores. Most callers should use Preference::GetValue() instead of |
+ // calling this method directly. |
+ bool GetValue(const std::string& name, |
+ Value::ValueType type, |
+ Value** out_value) const; |
// These methods return true if a preference with the given name is in the |
// indicated pref store, even if that value is currently being overridden by |
@@ -169,7 +155,7 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore>, |
PrefValueStore* pref_value_store_; |
// The PrefStore managed by this keeper. |
- scoped_ptr<PrefStore> pref_store_; |
+ scoped_refptr<PrefStore> pref_store_; |
// Type of the pref store. |
PrefStoreType type_; |
@@ -186,12 +172,6 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore>, |
FRIEND_TEST_ALL_PREFIXES(PrefValueStorePolicyRefreshTest, |
TestConcurrentPolicyRefresh); |
- // Returns true if the actual type is a valid type for the expected type when |
- // found in the given store. |
- static bool IsValidType(Value::ValueType expected, |
- Value::ValueType actual, |
- PrefStoreType store); |
- |
// Returns true if the preference with the given name has a value in the |
// given PrefStoreType, of the same value type as the preference was |
// registered with. |
@@ -240,9 +220,12 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore>, |
// RefreshPolicyPrefsOnFileThread takes ownership of the |callback| object. |
void RefreshPolicyPrefsOnFileThread( |
BrowserThread::ID calling_thread_id, |
- policy::ConfigurationPolicyPrefStore* new_managed_platform_pref_store, |
- policy::ConfigurationPolicyPrefStore* new_device_management_pref_store, |
- policy::ConfigurationPolicyPrefStore* new_recommended_pref_store); |
+ scoped_refptr<policy::ConfigurationPolicyPrefStore> |
+ new_managed_platform_pref_store, |
+ scoped_refptr<policy::ConfigurationPolicyPrefStore> |
+ new_device_management_pref_store, |
+ scoped_refptr<policy::ConfigurationPolicyPrefStore> |
+ _new_recommended_pref_store); |
// NotificationObserver methods: |
virtual void Observe(NotificationType type, |
@@ -281,9 +264,6 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore>, |
// corresponding PrefService. |
PrefNotifier* pref_notifier_; |
- // A mapping of preference names to their registered types. |
- PrefTypeMap pref_types_; |
- |
// The associated profile, in case this value store is associated with a |
// profile pref service. Used for recreating the device management pref store |
// upon policy refresh. |