OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #include "chrome/browser/prefs/chrome_pref_model_associator_client.h" | |
6 | |
7 #include "base/lazy_instance.h" | |
8 #include "chrome/common/pref_names.h" | |
9 #include "components/content_settings/core/browser/website_settings_info.h" | |
10 #include "components/content_settings/core/browser/website_settings_registry.h" | |
11 | |
12 namespace { | |
13 | |
14 base::LazyInstance<ChromePrefModelAssociatorClient> | |
15 g_chrome_pref_model_associatory_client; | |
16 | |
17 } // namespace | |
18 | |
19 ChromePrefModelAssociatorClient::ChromePrefModelAssociatorClient() { | |
20 RegisterPreference(prefs::kURLsToRestoreOnStartup, | |
21 PREF_MODEL_PREFERENCE_TYPE_LIST); | |
22 | |
23 content_settings::WebsiteSettingsRegistry* registry = | |
gab
2015/09/10 14:15:09
const& registry = *...GetInstance();
and then use
| |
24 content_settings::WebsiteSettingsRegistry::GetInstance(); | |
25 for (const content_settings::WebsiteSettingsInfo* info : *registry) { | |
26 RegisterPreference(info->pref_name(), PREF_MODEL_PREFERENCE_TYPE_DICT); | |
27 } | |
28 } | |
29 | |
30 ChromePrefModelAssociatorClient::~ChromePrefModelAssociatorClient() {} | |
31 | |
32 // static | |
33 ChromePrefModelAssociatorClient* | |
34 ChromePrefModelAssociatorClient::GetInstance() { | |
35 return g_chrome_pref_model_associatory_client.Pointer(); | |
36 } | |
OLD | NEW |