Chromium Code Reviews| Index: chrome/browser/prefs/pref_model_associator.cc |
| diff --git a/chrome/browser/prefs/pref_model_associator.cc b/chrome/browser/prefs/pref_model_associator.cc |
| index 4a3bd1f5ce5e4fec86871544ec8a67d63d901274..85623476d81795a5734fba46336251f0ecfecbee 100644 |
| --- a/chrome/browser/prefs/pref_model_associator.cc |
| +++ b/chrome/browser/prefs/pref_model_associator.cc |
| @@ -16,7 +16,7 @@ |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/prefs/pref_service_syncable.h" |
| #include "chrome/common/pref_names.h" |
| -#include "components/content_settings/core/browser/content_settings_pref_provider.h" |
| +#include "components/content_settings/core/browser/website_settings_registry.h" |
| #include "sync/api/sync_change.h" |
| #include "sync/api/sync_error_factory.h" |
| #include "sync/protocol/preference_specifics.pb.h" |
| @@ -324,9 +324,15 @@ scoped_ptr<base::Value> PrefModelAssociator::MergePreference( |
| MergeListValues(local_value, server_value)).Pass(); |
| } |
| - if (content_settings::PrefProvider::IsContentSettingsExceptionsPref(name)) { |
| - return scoped_ptr<base::Value>( |
| - MergeDictionaryValues(local_value, server_value)).Pass(); |
| + content_settings::WebsiteSettingsRegistry* registry = |
| + content_settings::WebsiteSettingsRegistry::GetInstance(); |
| + for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
| + ContentSettingsType type = static_cast<ContentSettingsType>(i); |
| + if (registry->Get(type)->pref_name() == name) { |
| + return scoped_ptr<base::Value>( |
|
Bernhard Bauer
2015/07/29 10:12:38
Can you use make_scoped_ptr()?
raymes
2015/07/30 05:25:03
Done.
|
| + MergeDictionaryValues(local_value, server_value)) |
| + .Pass(); |
|
Bernhard Bauer
2015/07/29 10:12:38
The .Pass() is only necessary to pass ownership fr
raymes
2015/07/30 05:25:03
Thanks - I wasn't really thinking about this as I
|
| + } |
| } |
| // If this is not a specially handled preference, server wins. |