From 76a6893ca1e3ef72d9d371c50c20c2600cca0e60 Mon Sep 17 00:00:00 2001 From: "deepak.m1" Date: Wed, 8 Apr 2015 21:05:54 -0700 Subject: Content settings clean-up: Clarify resource identifier & get rid of NO_RESOURCE_IDENTIFIER. current NO_RESOURCE_IDENTIFIER usage is aganinst style guidelines. Made a class in content_settings.h and using function to get std::string() To get rid of NO_RESOURCE_IDENTIFIER. Now no need to add content_settings_provider.h in places like desktop_notification_profile_util.cc and other places. BUG=399592 Review URL: https://codereview.chromium.org/1034143002 Cr-Commit-Position: refs/heads/master@{#324362} --- .../core/browser/content_settings_origin_identifier_value_map.h | 4 +--- .../core/browser/content_settings_policy_provider.cc | 6 ++---- .../content_settings/core/browser/content_settings_provider.h | 6 +----- components/content_settings/core/common/content_settings.h | 2 ++ 4 files changed, 6 insertions(+), 12 deletions(-) (limited to 'components/content_settings') diff --git a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h index 3489395..09cac65 100644 --- a/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h +++ b/components/content_settings/core/browser/content_settings_origin_identifier_value_map.h @@ -9,8 +9,7 @@ #include #include "base/memory/linked_ptr.h" -#include "components/content_settings/core/common/content_settings_pattern.h" -#include "components/content_settings/core/common/content_settings_types.h" +#include "components/content_settings/core/common/content_settings.h" class GURL; @@ -25,7 +24,6 @@ class RuleIterator; class OriginIdentifierValueMap { public: - typedef std::string ResourceIdentifier; struct EntryMapKey { ContentSettingsType content_type; ResourceIdentifier resource_identifier; diff --git a/components/content_settings/core/browser/content_settings_policy_provider.cc b/components/content_settings/core/browser/content_settings_policy_provider.cc index 445a4ad..8c65dbd 100644 --- a/components/content_settings/core/browser/content_settings_policy_provider.cc +++ b/components/content_settings/core/browser/content_settings_policy_provider.cc @@ -284,10 +284,8 @@ void PolicyProvider::GetContentSettingsFromPreferences( ContentSettingsPattern secondary_pattern = !pattern_pair.second.IsValid() ? ContentSettingsPattern::Wildcard() : pattern_pair.second; - value_map->SetValue(pattern_pair.first, - secondary_pattern, - content_type, - NO_RESOURCE_IDENTIFIER, + value_map->SetValue(pattern_pair.first, secondary_pattern, content_type, + ResourceIdentifier(), new base::FundamentalValue( kPrefsForManagedContentSettingsMap[i].setting)); } diff --git a/components/content_settings/core/browser/content_settings_provider.h b/components/content_settings/core/browser/content_settings_provider.h index a51ed52..c3e63e7 100644 --- a/components/content_settings/core/browser/content_settings_provider.h +++ b/components/content_settings/core/browser/content_settings_provider.h @@ -7,12 +7,10 @@ #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PROVIDER_H_ -#define NO_RESOURCE_IDENTIFIER std::string() - #include #include "base/values.h" -#include "components/content_settings/core/common/content_settings_types.h" +#include "components/content_settings/core/common/content_settings.h" class ContentSettingsPattern; @@ -21,8 +19,6 @@ namespace content_settings { struct Rule; class RuleIterator; -typedef std::string ResourceIdentifier; - class ProviderInterface { public: virtual ~ProviderInterface() {} diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h index 7745ac1..c7264476 100644 --- a/components/content_settings/core/common/content_settings.h +++ b/components/content_settings/core/common/content_settings.h @@ -62,6 +62,8 @@ struct RendererContentSettingRules { namespace content_settings { +typedef std::string ResourceIdentifier; + // Enum containing the various source for content settings. Settings can be // set by policy, extension, the user or by the custodian of a supervised user. // Certain (internal) schemes are whilelisted. For whilelisted schemes the -- cgit v1.1