diff options
author | deepak.m1 <deepak.m1@samsung.com> | 2015-04-08 21:05:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-09 04:06:16 +0000 |
commit | 76a6893ca1e3ef72d9d371c50c20c2600cca0e60 (patch) | |
tree | 809a509579d52230ad4b98dbaeac557c3cd4e306 /components/content_settings | |
parent | 2ba251cb5e44c1785748006025119c61b93d84d0 (diff) | |
download | chromium_src-76a6893ca1e3ef72d9d371c50c20c2600cca0e60.zip chromium_src-76a6893ca1e3ef72d9d371c50c20c2600cca0e60.tar.gz chromium_src-76a6893ca1e3ef72d9d371c50c20c2600cca0e60.tar.bz2 |
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}
Diffstat (limited to 'components/content_settings')
4 files changed, 6 insertions, 12 deletions
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 <string> #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 <string> #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 |