1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ios/chrome/browser/prefs/ios_chrome_pref_model_associator_client.h"
7 #include "base/memory/singleton.h"
8 #include "components/content_settings/core/browser/website_settings_info.h"
9 #include "components/content_settings/core/browser/website_settings_registry.h"
12 IOSChromePrefModelAssociatorClient
*
13 IOSChromePrefModelAssociatorClient::GetInstance() {
14 return base::Singleton
<IOSChromePrefModelAssociatorClient
>::get();
17 IOSChromePrefModelAssociatorClient::IOSChromePrefModelAssociatorClient() {}
19 IOSChromePrefModelAssociatorClient::~IOSChromePrefModelAssociatorClient() {}
21 bool IOSChromePrefModelAssociatorClient::IsMergeableListPreference(
22 const std::string
& pref_name
) const {
26 bool IOSChromePrefModelAssociatorClient::IsMergeableDictionaryPreference(
27 const std::string
& pref_name
) const {
28 const content_settings::WebsiteSettingsRegistry
& registry
=
29 *content_settings::WebsiteSettingsRegistry::GetInstance();
30 for (const content_settings::WebsiteSettingsInfo
* info
: registry
) {
31 if (info
->pref_name() == pref_name
)
37 bool IOSChromePrefModelAssociatorClient::IsMigratedPreference(
38 const std::string
& new_pref_name
,
39 std::string
* old_pref_name
) const {
43 bool IOSChromePrefModelAssociatorClient::IsOldMigratedPreference(
44 const std::string
& old_pref_name
,
45 std::string
* new_pref_name
) const {