| Index: chrome/browser/extensions/extension_prefs.cc
|
| diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
|
| index dbbbf8d4115408fe03d568fca98e441d763afe32..9676f74170c8c9cf48b6f36ed0e1bbfb06197aa8 100644
|
| --- a/chrome/browser/extensions/extension_prefs.cc
|
| +++ b/chrome/browser/extensions/extension_prefs.cc
|
| @@ -311,7 +311,7 @@ void ExtensionPrefs::MakePathsRelative() {
|
| std::set<std::string> absolute_keys;
|
| for (DictionaryValue::key_iterator i = dict->begin_keys();
|
| i != dict->end_keys(); ++i) {
|
| - DictionaryValue* extension_dict = NULL;
|
| + const DictionaryValue* extension_dict = NULL;
|
| if (!dict->GetDictionaryWithoutPathExpansion(*i, &extension_dict))
|
| continue;
|
| int location_value;
|
| @@ -332,7 +332,7 @@ void ExtensionPrefs::MakePathsRelative() {
|
|
|
| // Fix these paths.
|
| DictionaryPrefUpdate update(prefs_, kExtensionsPref);
|
| - const DictionaryValue* update_dict = update.Get();
|
| + DictionaryValue* update_dict = update.Get();
|
| for (std::set<std::string>::iterator i = absolute_keys.begin();
|
| i != absolute_keys.end(); ++i) {
|
| DictionaryValue* extension_dict = NULL;
|
| @@ -430,7 +430,7 @@ bool ExtensionPrefs::ReadExtensionPrefList(
|
| const std::string& extension_id, const std::string& pref_key,
|
| const ListValue** out_value) const {
|
| const DictionaryValue* ext = GetExtensionPref(extension_id);
|
| - ListValue* out = NULL;
|
| + const ListValue* out = NULL;
|
| if (!ext || !ext->GetList(pref_key, &out))
|
| return false;
|
| if (out_value)
|
| @@ -540,7 +540,7 @@ void ExtensionPrefs::SetExtensionPrefPermissionSet(
|
| }
|
|
|
| // static
|
| -bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) {
|
| +bool ExtensionPrefs::IsBlacklistBitSet(const DictionaryValue* ext) {
|
| return ReadBooleanFromPref(ext, kPrefBlacklist);
|
| }
|
|
|
| @@ -707,7 +707,7 @@ void ExtensionPrefs::UpdateBlacklist(
|
| if (extensions) {
|
| for (DictionaryValue::key_iterator extension_id = extensions->begin_keys();
|
| extension_id != extensions->end_keys(); ++extension_id) {
|
| - DictionaryValue* ext;
|
| + const DictionaryValue* ext;
|
| if (!extensions->GetDictionaryWithoutPathExpansion(*extension_id, &ext)) {
|
| NOTREACHED() << "Invalid pref for extension " << *extension_id;
|
| continue;
|
| @@ -848,7 +848,7 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) {
|
|
|
| // Add the plugin permission if the full access bit was set.
|
| if (full_access) {
|
| - ListValue* apis = NULL;
|
| + const ListValue* apis = NULL;
|
| ListValue* new_apis = NULL;
|
|
|
| std::string granted_apis =
|
| @@ -870,7 +870,7 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdSet& extension_ids) {
|
| // does not matter how we treat the old effective hosts as long as the
|
| // new effective hosts will be the same, so we move them to explicit
|
| // host permissions.
|
| - ListValue* hosts;
|
| + const ListValue* hosts;
|
| std::string explicit_hosts =
|
| JoinPrefs(kPrefGrantedPermissions, kPrefExplicitHosts);
|
| if (ext->GetList(kPrefOldGrantedHosts, &hosts)) {
|
| @@ -945,7 +945,7 @@ std::set<std::string> ExtensionPrefs::GetRegisteredEvents(
|
| if (!extension)
|
| return events;
|
|
|
| - ListValue* value = NULL;
|
| + const ListValue* value = NULL;
|
| if (!extension->GetList(kRegisteredEvents, &value))
|
| return events;
|
|
|
| @@ -1004,7 +1004,7 @@ const DictionaryValue* ExtensionPrefs::GetFilteredEvents(
|
| const DictionaryValue* extension = GetExtensionPref(extension_id);
|
| if (!extension)
|
| return NULL;
|
| - DictionaryValue* result = NULL;
|
| + const DictionaryValue* result = NULL;
|
| if (!extension->GetDictionary(kFilteredEvents, &result))
|
| return NULL;
|
| return result;
|
| @@ -1024,8 +1024,8 @@ ExtensionOmniboxSuggestion
|
| ExtensionPrefs::GetOmniboxDefaultSuggestion(const std::string& extension_id) {
|
| ExtensionOmniboxSuggestion suggestion;
|
|
|
| - const base::DictionaryValue* extension = GetExtensionPref(extension_id);
|
| - base::DictionaryValue* dict = NULL;
|
| + const DictionaryValue* extension = GetExtensionPref(extension_id);
|
| + const DictionaryValue* dict = NULL;
|
| if (extension && extension->GetDictionary(kOmniboxDefaultSuggestion, &dict))
|
| suggestion.Populate(*dict, false);
|
|
|
| @@ -1336,7 +1336,7 @@ void ExtensionPrefs::UpdateManifest(const Extension* extension) {
|
| const DictionaryValue* extension_dict = GetExtensionPref(extension->id());
|
| if (!extension_dict)
|
| return;
|
| - DictionaryValue* old_manifest = NULL;
|
| + const DictionaryValue* old_manifest = NULL;
|
| bool update_required =
|
| !extension_dict->GetDictionary(kPrefManifest, &old_manifest) ||
|
| !extension->manifest()->value()->Equals(old_manifest);
|
| @@ -1386,7 +1386,7 @@ const DictionaryValue* ExtensionPrefs::GetExtensionPref(
|
| const DictionaryValue* dict = prefs_->GetDictionary(kExtensionsPref);
|
| if (!dict)
|
| return NULL;
|
| - DictionaryValue* extension = NULL;
|
| + const DictionaryValue* extension = NULL;
|
| dict->GetDictionary(extension_id, &extension);
|
| return extension;
|
| }
|
| @@ -1518,7 +1518,7 @@ bool ExtensionPrefs::GetIdleInstallInfo(const std::string& extension_id,
|
|
|
| // Do all the reads from the prefs together, and don't do any assignment
|
| // to the out parameters unless all the reads succeed.
|
| - DictionaryValue* info = NULL;
|
| + const DictionaryValue* info = NULL;
|
| if (!extension_prefs->GetDictionary(kIdleInstallInfo, &info))
|
| return false;
|
|
|
| @@ -1683,7 +1683,7 @@ ExtensionPrefs::ExtensionIdSet ExtensionPrefs::GetExtensionsFrom(
|
| ExtensionIdSet result;
|
| for (base::DictionaryValue::key_iterator it = extension_prefs->begin_keys();
|
| it != extension_prefs->end_keys(); ++it) {
|
| - DictionaryValue* ext;
|
| + const DictionaryValue* ext;
|
| if (!extension_prefs->GetDictionaryWithoutPathExpansion(*it, &ext)) {
|
| NOTREACHED() << "Invalid pref for extension " << *it;
|
| continue;
|
| @@ -1718,7 +1718,7 @@ void ExtensionPrefs::LoadExtensionControlledPrefs(
|
| bool success = ScopeToPrefKey(scope, &scope_string);
|
| DCHECK(success);
|
| std::string key = extension_id + "." + scope_string;
|
| - DictionaryValue* preferences = NULL;
|
| + const DictionaryValue* preferences = NULL;
|
| // First try the regular lookup.
|
| const DictionaryValue* source_dict = prefs_->GetDictionary(kExtensionsPref);
|
| if (!source_dict->GetDictionary(key, &preferences))
|
| @@ -1778,7 +1778,7 @@ void ExtensionPrefs::InitPrefStore(bool extensions_disabled) {
|
| // Set content settings.
|
| const DictionaryValue* extension_prefs = GetExtensionPref(*ext_id);
|
| DCHECK(extension_prefs);
|
| - ListValue* content_settings = NULL;
|
| + const ListValue* content_settings = NULL;
|
| if (extension_prefs->GetList(kPrefContentSettings,
|
| &content_settings)) {
|
| content_settings_store_->SetExtensionContentSettingFromList(
|
|
|