| Index: components/pref_registry/pref_registry_syncable.cc
|
| diff --git a/components/pref_registry/pref_registry_syncable.cc b/components/pref_registry/pref_registry_syncable.cc
|
| index 49d0020a39f103a4713da81afaa8ffb82b1e8900..12b2bc6643c9fcd6677589e30180352a24d7b393 100644
|
| --- a/components/pref_registry/pref_registry_syncable.cc
|
| +++ b/components/pref_registry/pref_registry_syncable.cc
|
| @@ -17,11 +17,6 @@ PrefRegistrySyncable::PrefRegistrySyncable() {
|
| PrefRegistrySyncable::~PrefRegistrySyncable() {
|
| }
|
|
|
| -const PrefRegistrySyncable::PrefToStatus&
|
| -PrefRegistrySyncable::syncable_preferences() const {
|
| - return syncable_preferences_;
|
| -}
|
| -
|
| void PrefRegistrySyncable::SetSyncableRegistrationCallback(
|
| const SyncableRegistrationCallback& cb) {
|
| callback_ = cb;
|
| @@ -29,95 +24,96 @@ void PrefRegistrySyncable::SetSyncableRegistrationCallback(
|
|
|
| void PrefRegistrySyncable::RegisterBooleanPref(const char* path,
|
| bool default_value,
|
| - PrefSyncStatus sync_status) {
|
| + uint32 flags) {
|
| RegisterSyncablePreference(
|
| - path, new base::FundamentalValue(default_value), sync_status);
|
| + path, new base::FundamentalValue(default_value), flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterIntegerPref(const char* path,
|
| int default_value,
|
| - PrefSyncStatus sync_status) {
|
| + uint32 flags) {
|
| RegisterSyncablePreference(
|
| - path, new base::FundamentalValue(default_value), sync_status);
|
| + path, new base::FundamentalValue(default_value), flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterDoublePref(const char* path,
|
| double default_value,
|
| - PrefSyncStatus sync_status) {
|
| + uint32 flags) {
|
| RegisterSyncablePreference(
|
| - path, new base::FundamentalValue(default_value), sync_status);
|
| + path, new base::FundamentalValue(default_value), flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterStringPref(const char* path,
|
| const std::string& default_value,
|
| - PrefSyncStatus sync_status) {
|
| + uint32 flags) {
|
| RegisterSyncablePreference(
|
| - path, new base::StringValue(default_value), sync_status);
|
| + path, new base::StringValue(default_value), flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterFilePathPref(
|
| const char* path,
|
| const base::FilePath& default_value,
|
| - PrefSyncStatus sync_status) {
|
| + uint32 flags) {
|
| RegisterSyncablePreference(
|
| - path, new base::StringValue(default_value.value()), sync_status);
|
| + path, new base::StringValue(default_value.value()), flags);
|
| }
|
|
|
| -void PrefRegistrySyncable::RegisterListPref(const char* path,
|
| - PrefSyncStatus sync_status) {
|
| - RegisterSyncablePreference(path, new base::ListValue(), sync_status);
|
| +void PrefRegistrySyncable::RegisterListPref(const char* path, uint32 flags) {
|
| + RegisterSyncablePreference(path, new base::ListValue(), flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterListPref(const char* path,
|
| base::ListValue* default_value,
|
| - PrefSyncStatus sync_status) {
|
| - RegisterSyncablePreference(path, default_value, sync_status);
|
| + uint32 flags) {
|
| + RegisterSyncablePreference(path, default_value, flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterDictionaryPref(const char* path,
|
| - PrefSyncStatus sync_status) {
|
| - RegisterSyncablePreference(path, new base::DictionaryValue(), sync_status);
|
| + uint32 flags) {
|
| + RegisterSyncablePreference(path, new base::DictionaryValue(), flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterDictionaryPref(
|
| const char* path,
|
| base::DictionaryValue* default_value,
|
| - PrefSyncStatus sync_status) {
|
| - RegisterSyncablePreference(path, default_value, sync_status);
|
| + uint32 flags) {
|
| + RegisterSyncablePreference(path, default_value, flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterInt64Pref(
|
| const char* path,
|
| int64 default_value,
|
| - PrefSyncStatus sync_status) {
|
| + uint32 flags) {
|
| RegisterSyncablePreference(
|
| path,
|
| new base::StringValue(base::Int64ToString(default_value)),
|
| - sync_status);
|
| + flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterUint64Pref(
|
| const char* path,
|
| uint64 default_value,
|
| - PrefSyncStatus sync_status) {
|
| + uint32 flags) {
|
| RegisterSyncablePreference(
|
| path,
|
| new base::StringValue(base::Uint64ToString(default_value)),
|
| - sync_status);
|
| + flags);
|
| }
|
|
|
| void PrefRegistrySyncable::RegisterSyncablePreference(
|
| const char* path,
|
| base::Value* default_value,
|
| - PrefSyncStatus sync_status) {
|
| - PrefRegistry::RegisterPreference(path, default_value);
|
| -
|
| - if (sync_status == PrefRegistrySyncable::SYNCABLE_PREF ||
|
| - sync_status == PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF) {
|
| - syncable_preferences_[path] = sync_status;
|
| -
|
| + uint32 flags) {
|
| + // Tests that |flags| does not contain both SYNCABLE_PREF and
|
| + // SYNCABLE_PRIORITY_PREF flags at the same time.
|
| + DCHECK(!(flags & PrefRegistrySyncable::SYNCABLE_PREF) ||
|
| + !(flags & PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF));
|
| + PrefRegistry::RegisterPreference(path, default_value, flags);
|
| +
|
| + if (flags & PrefRegistrySyncable::SYNCABLE_PREF ||
|
| + flags & PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF) {
|
| if (!callback_.is_null())
|
| - callback_.Run(path, sync_status);
|
| + callback_.Run(path, flags);
|
| }
|
| }
|
|
|
|
|