summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authordgrogan <dgrogan@chromium.org>2015-07-03 15:32:27 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-03 22:33:17 +0000
commit7e762c1f17514a29834506860961ba2f24e7e6e5 (patch)
treee7707244b41a2dcbb4ba708947010698cfda0811 /components
parent39ff056a6605c65862b759940c3cd48d20ee5391 (diff)
downloadchromium_src-7e762c1f17514a29834506860961ba2f24e7e6e5.zip
chromium_src-7e762c1f17514a29834506860961ba2f24e7e6e5.tar.gz
chromium_src-7e762c1f17514a29834506860961ba2f24e7e6e5.tar.bz2
Add durable storage to content settings enum and prefs file.
Split off from https://codereview.chromium.org/1164073005/ to keep the permission-requesting and quota logic changes clearer. BUG=482814 Review URL: https://codereview.chromium.org/1217893006 Cr-Commit-Position: refs/heads/master@{#337331}
Diffstat (limited to 'components')
-rw-r--r--components/content_settings/core/browser/content_settings_default_provider.cc1
-rw-r--r--components/content_settings/core/browser/content_settings_policy_provider.cc1
-rw-r--r--components/content_settings/core/browser/content_settings_pref_provider.cc1
-rw-r--r--components/content_settings/core/browser/content_settings_utils.cc1
-rw-r--r--components/content_settings/core/common/content_settings.cc3
-rw-r--r--components/content_settings/core/common/content_settings_types.h2
-rw-r--r--components/content_settings/core/common/pref_names.cc4
-rw-r--r--components/content_settings/core/common/pref_names.h2
8 files changed, 15 insertions, 0 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 45a9fd6..0bf7514 100644
--- a/components/content_settings/core/browser/content_settings_default_provider.cc
+++ b/components/content_settings/core/browser/content_settings_default_provider.cc
@@ -66,6 +66,7 @@ const DefaultContentSettingInfo kDefaultSettings[] = {
#endif
{prefs::kDefaultAppBannerSetting, CONTENT_SETTING_DEFAULT},
{prefs::kDefaultSiteEngagementSetting, CONTENT_SETTING_DEFAULT},
+ {prefs::kDefaultDurableStorageSetting, CONTENT_SETTING_ASK},
};
static_assert(arraysize(kDefaultSettings) == CONTENT_SETTINGS_NUM_TYPES,
"kDefaultSettings should have CONTENT_SETTINGS_NUM_TYPES "
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 7b3faee..a171f48 100644
--- a/components/content_settings/core/browser/content_settings_policy_provider.cc
+++ b/components/content_settings/core/browser/content_settings_policy_provider.cc
@@ -48,6 +48,7 @@ const char* kPrefToManageType[] = {
#endif
nullptr, // No policy for default value of app banners
nullptr, // No policy for default value of site engagement
+ nullptr, // No policy for default value of durable storage
};
static_assert(arraysize(kPrefToManageType) == CONTENT_SETTINGS_NUM_TYPES,
"kPrefToManageType should have CONTENT_SETTINGS_NUM_TYPES "
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 118cabf..ef80480 100644
--- a/components/content_settings/core/browser/content_settings_pref_provider.cc
+++ b/components/content_settings/core/browser/content_settings_pref_provider.cc
@@ -95,6 +95,7 @@ const char* kContentSettingsExceptionsPrefs[] = {
#endif
prefs::kContentSettingsAppBannerPatternPairs,
prefs::kContentSettingsSiteEngagementPatternPairs,
+ prefs::kContentSettingsDurableStoragePatternPairs,
};
static_assert(arraysize(kContentSettingsExceptionsPrefs)
== CONTENT_SETTINGS_NUM_TYPES,
diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc
index fc4b47a..eb91f0b 100644
--- a/components/content_settings/core/browser/content_settings_utils.cc
+++ b/components/content_settings/core/browser/content_settings_utils.cc
@@ -51,6 +51,7 @@ const char* kTypeNames[] = {
#endif
"app-banner",
"site-engagement",
+ "durable-storage"
};
static_assert(arraysize(kTypeNames) == CONTENT_SETTINGS_NUM_TYPES,
"kTypeNames should have CONTENT_SETTINGS_NUM_TYPES elements");
diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc
index 4840aa2..a9f3867 100644
--- a/components/content_settings/core/common/content_settings.cc
+++ b/components/content_settings/core/common/content_settings.cc
@@ -68,6 +68,8 @@ ContentSettingsTypeHistogram ContentSettingTypeToHistogramValue(
return CONTENT_SETTINGS_TYPE_HISTOGRAM_APP_BANNER;
case CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT:
return CONTENT_SETTINGS_TYPE_HISTOGRAM_SITE_ENGAGEMENT;
+ case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE:
+ return CONTENT_SETTINGS_TYPE_HISTOGRAM_DURABLE_STORAGE;
case CONTENT_SETTINGS_NUM_TYPES:
return CONTENT_SETTINGS_TYPE_HISTOGRAM_INVALID;
}
@@ -107,6 +109,7 @@ bool IsContentSettingsTypeSyncable(ContentSettingsType content_setting) {
#endif
case CONTENT_SETTINGS_TYPE_APP_BANNER:
case CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT:
+ case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE:
return false;
case CONTENT_SETTINGS_TYPE_DEFAULT:
diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h
index 155cfd9..7fa6106 100644
--- a/components/content_settings/core/common/content_settings_types.h
+++ b/components/content_settings/core/common/content_settings_types.h
@@ -48,6 +48,7 @@ enum ContentSettingsType {
#endif
CONTENT_SETTINGS_TYPE_APP_BANNER,
CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT,
+ CONTENT_SETTINGS_TYPE_DURABLE_STORAGE,
CONTENT_SETTINGS_NUM_TYPES,
};
@@ -81,6 +82,7 @@ enum ContentSettingsTypeHistogram {
CONTENT_SETTINGS_TYPE_HISTOGRAM_PROTECTED_MEDIA_IDENTIFIER,
CONTENT_SETTINGS_TYPE_HISTOGRAM_APP_BANNER,
CONTENT_SETTINGS_TYPE_HISTOGRAM_SITE_ENGAGEMENT,
+ CONTENT_SETTINGS_TYPE_HISTOGRAM_DURABLE_STORAGE,
CONTENT_SETTINGS_HISTOGRAM_NUM_TYPES,
};
diff --git a/components/content_settings/core/common/pref_names.cc b/components/content_settings/core/common/pref_names.cc
index ac31d79..4e78675 100644
--- a/components/content_settings/core/common/pref_names.cc
+++ b/components/content_settings/core/common/pref_names.cc
@@ -85,6 +85,8 @@ const char kDefaultAppBannerSetting[] =
"profile.default_content_setting_values.app_banner";
const char kDefaultSiteEngagementSetting[] =
"profile.default_content_setting_values.site_engagement";
+const char kDefaultDurableStorageSetting[] =
+ "profile.default_content_setting_values.durable_storage";
// Boolean indicating whether the media stream default setting had been
// migrated into two separate microphone and camera settings.
@@ -148,6 +150,8 @@ const char kContentSettingsAppBannerPatternPairs[] =
"profile.content_settings.exceptions.app_banner";
const char kContentSettingsSiteEngagementPatternPairs[] =
"profile.content_settings.exceptions.site_engagement";
+const char kContentSettingsDurableStoragePatternPairs[] =
+ "profile.content_settings.exceptions.durable_storage";
// Whether the patern pairs have been migrated from the deprecated aggregate
// preference |kContentSettingsPatternPairs| to the separate preferences
diff --git a/components/content_settings/core/common/pref_names.h b/components/content_settings/core/common/pref_names.h
index fabce57..d6a5ce6 100644
--- a/components/content_settings/core/common/pref_names.h
+++ b/components/content_settings/core/common/pref_names.h
@@ -44,6 +44,7 @@ extern const char kDefaultProtectedMediaIdentifierSetting[];
#endif
extern const char kDefaultAppBannerSetting[];
extern const char kDefaultSiteEngagementSetting[];
+extern const char kDefaultDurableStorageSetting[];
extern const char kMigratedDefaultMediaStreamSetting[];
@@ -75,6 +76,7 @@ extern const char kContentSettingsProtectedMediaIdentifierPatternPairs[];
#endif
extern const char kContentSettingsAppBannerPatternPairs[];
extern const char kContentSettingsSiteEngagementPatternPairs[];
+extern const char kContentSettingsDurableStoragePatternPairs[];
extern const char kMigratedContentSettingsPatternPairs[];