diff options
author | deepak.m1 <deepak.m1@samsung.com> | 2015-04-10 05:14:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-10 12:15:22 +0000 |
commit | bc8118fa3784612fcd8c2ec49ecce355b203f25d (patch) | |
tree | 49fc61f6c0a5c6774dd1fb08edb481d9c8a5282c /components/content_settings | |
parent | 20bd1637e164636a9e1f78bc1c98105e1fa8b033 (diff) | |
download | chromium_src-bc8118fa3784612fcd8c2ec49ecce355b203f25d.zip chromium_src-bc8118fa3784612fcd8c2ec49ecce355b203f25d.tar.gz chromium_src-bc8118fa3784612fcd8c2ec49ecce355b203f25d.tar.bz2 |
Coverting std::String() to ResourceIdentifier() in content_settings.
This is follow up of issue 399592 for replacing NO_RESOURCE_IDENTIFER with
ResourceIdentifier, With these changes their will be no std::String() in content_settings.
so usage is more consistent.
BUG=475862
Review URL: https://codereview.chromium.org/1076153002
Cr-Commit-Position: refs/heads/master@{#324619}
Diffstat (limited to 'components/content_settings')
4 files changed, 21 insertions, 15 deletions
diff --git a/components/content_settings/core/browser/content_settings_default_provider.cc b/components/content_settings/core/browser/content_settings_default_provider.cc index 07adc4d..704e2fd 100644 --- a/components/content_settings/core/browser/content_settings_default_provider.cc +++ b/components/content_settings/core/browser/content_settings_default_provider.cc @@ -267,7 +267,7 @@ bool DefaultProvider::SetWebsiteSetting( NotifyObservers(ContentSettingsPattern(), ContentSettingsPattern(), content_type, - std::string()); + ResourceIdentifier()); return true; } @@ -423,7 +423,7 @@ void DefaultProvider::OnPreferenceChanged(const std::string& name) { NotifyObservers(ContentSettingsPattern(), ContentSettingsPattern(), content_type, - std::string()); + ResourceIdentifier()); } } diff --git a/components/content_settings/core/browser/content_settings_pref.cc b/components/content_settings/core/browser/content_settings_pref.cc index e18fa28..4c48da3 100644 --- a/components/content_settings/core/browser/content_settings_pref.cc +++ b/components/content_settings/core/browser/content_settings_pref.cc @@ -165,31 +165,33 @@ void ContentSettingsPref::ClearAllContentSettingsRules() { { base::AutoLock auto_lock(lock_); scoped_ptr<RuleIterator> rule_iterator( - map_to_modify->GetRuleIterator(content_type_, std::string(), NULL)); + map_to_modify->GetRuleIterator(content_type_, + ResourceIdentifier(), + NULL)); // Copy the rules; we cannot call |UpdatePref| while holding |lock_|. while (rule_iterator->HasNext()) rules_to_delete.push_back(rule_iterator->Next()); - map_to_modify->DeleteValues(content_type_, std::string()); + map_to_modify->DeleteValues(content_type_, ResourceIdentifier()); } for (std::vector<Rule>::const_iterator it = rules_to_delete.begin(); it != rules_to_delete.end(); ++it) { UpdatePref(it->primary_pattern, it->secondary_pattern, - std::string(), + ResourceIdentifier(), NULL); if (IsContentSettingsTypeSyncable(content_type_)) { UpdateOldPref(it->primary_pattern, it->secondary_pattern, - std::string(), + ResourceIdentifier(), NULL); } } notify_callback_.Run(ContentSettingsPattern(), ContentSettingsPattern(), content_type_, - std::string()); + ResourceIdentifier()); } void ContentSettingsPref::UpdateLastUsage( @@ -419,7 +421,7 @@ void ContentSettingsPref::OnPrefChanged() { notify_callback_.Run(ContentSettingsPattern(), ContentSettingsPattern(), content_type_, - std::string()); + ResourceIdentifier()); } void ContentSettingsPref::UpdatePref( diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc index f53acc3..6f7c006 100644 --- a/components/content_settings/core/browser/content_settings_pref_provider.cc +++ b/components/content_settings/core/browser/content_settings_pref_provider.cc @@ -300,7 +300,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() { std::vector<Rule> rules_to_delete; { scoped_ptr<RuleIterator> rule_iterator(GetRuleIterator( - CONTENT_SETTINGS_TYPE_MEDIASTREAM, std::string(), false)); + CONTENT_SETTINGS_TYPE_MEDIASTREAM, ResourceIdentifier(), false)); while (rule_iterator->HasNext()) { // Skip default setting and rules without a value. const content_settings::Rule& rule = rule_iterator->Next(); @@ -325,7 +325,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() { SetWebsiteSetting(it->primary_pattern, it->secondary_pattern, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, - std::string(), + ResourceIdentifier(), new base::FundamentalValue(CONTENT_SETTING_ALLOW)); } // Add the exception to the new camera content setting. @@ -333,7 +333,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() { SetWebsiteSetting(it->primary_pattern, it->secondary_pattern, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, - std::string(), + ResourceIdentifier(), new base::FundamentalValue(CONTENT_SETTING_ALLOW)); } @@ -341,7 +341,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() { SetWebsiteSetting(it->primary_pattern, it->secondary_pattern, CONTENT_SETTINGS_TYPE_MEDIASTREAM, - std::string(), + ResourceIdentifier(), NULL); } } diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc index a67bb7d..2c774fb 100644 --- a/components/content_settings/core/browser/content_settings_utils.cc +++ b/components/content_settings/core/browser/content_settings_utils.cc @@ -91,7 +91,7 @@ std::string ContentSettingToString(ContentSetting setting) { NOTREACHED(); } - return std::string(); + return ResourceIdentifier(); } ContentSetting ContentSettingFromString(const std::string& name) { @@ -229,9 +229,13 @@ base::Value* GetContentSettingValueAndPatterns( void GetRendererContentSettingRules(const HostContentSettingsMap* map, RendererContentSettingRules* rules) { map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &(rules->image_rules)); + CONTENT_SETTINGS_TYPE_IMAGES, + ResourceIdentifier(), + &(rules->image_rules)); map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &(rules->script_rules)); + CONTENT_SETTINGS_TYPE_JAVASCRIPT, + ResourceIdentifier(), + &(rules->script_rules)); } } // namespace content_settings |