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

Side by Side Diff: chrome/browser/extensions/extension_prefs.cc

Issue 5441002: Clean up pref change notification handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_prefs.h" 5 #include "chrome/browser/extensions/extension_prefs.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/prefs/pref_notifier.h" 10 #include "chrome/browser/prefs/pref_notifier.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 for (std::set<std::string>::const_iterator iter = new_value.begin(); 319 for (std::set<std::string>::const_iterator iter = new_value.begin();
320 iter != new_value.end(); ++iter) 320 iter != new_value.end(); ++iter)
321 value->Append(Value::CreateStringValue(*iter)); 321 value->Append(Value::CreateStringValue(*iter));
322 322
323 UpdateExtensionPref(extension_id, pref_key, value); 323 UpdateExtensionPref(extension_id, pref_key, value);
324 prefs_->ScheduleSavePersistentPrefs(); 324 prefs_->ScheduleSavePersistentPrefs();
325 } 325 }
326 326
327 void ExtensionPrefs::SavePrefsAndNotify() { 327 void ExtensionPrefs::SavePrefsAndNotify() {
328 prefs_->ScheduleSavePersistentPrefs(); 328 prefs_->ScheduleSavePersistentPrefs();
329 prefs_->pref_notifier()->OnUserPreferenceSet(kExtensionsPref); 329 prefs_->pref_notifier()->OnPreferenceChanged(kExtensionsPref);
battre (please use the other) 2010/12/02 10:41:19 OnPreferenceChanged has the connotation that the p
Mattias Nissler (ping if slow) 2010/12/02 16:38:24 You are right, that is not the case. However, the
330 } 330 }
331 331
332 bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) { 332 bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) {
333 return ReadBooleanFromPref(ext, kPrefBlacklist); 333 return ReadBooleanFromPref(ext, kPrefBlacklist);
334 } 334 }
335 335
336 bool ExtensionPrefs::IsExtensionBlacklisted(const std::string& extension_id) { 336 bool ExtensionPrefs::IsExtensionBlacklisted(const std::string& extension_id) {
337 return ReadExtensionPrefBoolean(extension_id, kPrefBlacklist); 337 return ReadExtensionPrefBoolean(extension_id, kPrefBlacklist);
338 } 338 }
339 339
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) { 1094 void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) {
1095 prefs->RegisterDictionaryPref(kExtensionsPref); 1095 prefs->RegisterDictionaryPref(kExtensionsPref);
1096 prefs->RegisterListPref(kExtensionToolbar); 1096 prefs->RegisterListPref(kExtensionToolbar);
1097 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1); 1097 prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1);
1098 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate); 1098 prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate);
1099 prefs->RegisterListPref(prefs::kExtensionInstallAllowList); 1099 prefs->RegisterListPref(prefs::kExtensionInstallAllowList);
1100 prefs->RegisterListPref(prefs::kExtensionInstallDenyList); 1100 prefs->RegisterListPref(prefs::kExtensionInstallDenyList);
1101 prefs->RegisterListPref(prefs::kExtensionInstallForceList); 1101 prefs->RegisterListPref(prefs::kExtensionInstallForceList);
1102 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */); 1102 prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */);
1103 } 1103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698