Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: chrome/browser/prefs/chrome_pref_model_associator_client.cc

Issue 1326353002: Remove dependency of PrefSyncableService on Profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_model_associator
Patch Set: Move files back to //chrome/browser/prefs & //chrome/test/base Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prefs/chrome_pref_model_associator_client.cc
diff --git a/chrome/browser/prefs/chrome_pref_model_associator_client.cc b/chrome/browser/prefs/chrome_pref_model_associator_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e290ef1b5b22d6027d37beb186c7e8c661fd692f
--- /dev/null
+++ b/chrome/browser/prefs/chrome_pref_model_associator_client.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/prefs/chrome_pref_model_associator_client.h"
+
+#include "base/lazy_instance.h"
+#include "chrome/common/pref_names.h"
+#include "components/content_settings/core/browser/website_settings_info.h"
+#include "components/content_settings/core/browser/website_settings_registry.h"
+
+namespace {
+
+base::LazyInstance<ChromePrefModelAssociatorClient>
+ g_chrome_pref_model_associatory_client;
+
+} // namespace
+
+ChromePrefModelAssociatorClient::ChromePrefModelAssociatorClient() {
+ RegisterPreference(prefs::kURLsToRestoreOnStartup,
+ PREF_MODEL_PREFERENCE_TYPE_LIST);
+
+ content_settings::WebsiteSettingsRegistry* registry =
gab 2015/09/10 14:15:09 const& registry = *...GetInstance(); and then use
+ content_settings::WebsiteSettingsRegistry::GetInstance();
+ for (const content_settings::WebsiteSettingsInfo* info : *registry) {
+ RegisterPreference(info->pref_name(), PREF_MODEL_PREFERENCE_TYPE_DICT);
+ }
+}
+
+ChromePrefModelAssociatorClient::~ChromePrefModelAssociatorClient() {}
+
+// static
+ChromePrefModelAssociatorClient*
+ChromePrefModelAssociatorClient::GetInstance() {
+ return g_chrome_pref_model_associatory_client.Pointer();
+}

Powered by Google App Engine
This is Rietveld 408576698