Directly observe the disabled schemes policy instead of via a PrefMember.
Also, remove some now-obsolete pref code and clean up PrefService a bit.
BUG=80025
TEST=none
Review URL: http://codereview.chromium.org/6900056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83157 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index e318bf7..208336d 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -871,11 +871,10 @@
local_state_.get(), NULL);
plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO);
- // Initialize the preference for the disabled schemes policy, and
- // load the initial policy on startup.
+ // This is observed by ChildProcessSecurityPolicy, which lives in content/
+ // though, so it can't register itself.
local_state_->RegisterListPref(prefs::kDisabledSchemes);
- disabled_schemes_pref_.Init(prefs::kDisabledSchemes, local_state_.get(),
- this);
+ pref_change_registrar_.Add(prefs::kDisabledSchemes, this);
ApplyDisabledSchemesPolicy();
}
@@ -961,8 +960,9 @@
void BrowserProcessImpl::ApplyDisabledSchemesPolicy() {
std::set<std::string> schemes;
- for (ListValue::const_iterator iter = (*disabled_schemes_pref_)->begin();
- iter != (*disabled_schemes_pref_)->end(); ++iter) {
+ const ListValue* scheme_list = local_state_->GetList(prefs::kDisabledSchemes);
+ for (ListValue::const_iterator iter = scheme_list->begin();
+ iter != scheme_list->end(); ++iter) {
std::string scheme;
if ((*iter)->GetAsString(&scheme))
schemes.insert(scheme);