Commit c1a84134 authored by finnur's avatar finnur Committed by Commit bot

MD Site Settings: Implement the third-party checkbox for Cookies.

BUG=614277, 543635
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2031833003
Cr-Commit-Position: refs/heads/master@{#397842}
parent b2768db2
...@@ -1081,6 +1081,12 @@ ...@@ -1081,6 +1081,12 @@
<message name="IDS_SETTINGS_SITE_SETTINGS_DELETE" desc="Label for the trashcan icon used to delete storage on the Site Details page."> <message name="IDS_SETTINGS_SITE_SETTINGS_DELETE" desc="Label for the trashcan icon used to delete storage on the Site Details page.">
Delete Delete
</message> </message>
<message name="IDS_SETTINGS_SITE_SETTINGS_THIRD_PARTY_COOKIE" desc="Label for the Block 3rd-party cookie checkbox on the Cookies category.">
Block third-party cookies.
</message>
<message name="IDS_SETTINGS_SITE_SETTINGS_THIRD_PARTY_COOKIE_SUBLABEL" desc="A sub-label below the Block 3rd-party cookie checkbox.">
Prevent third-party websites from saving and reading cookie data.
</message>
<!-- Sync / People Page --> <!-- Sync / People Page -->
<message name="IDS_SETTINGS_PEOPLE" desc="Name of the settings page which manages Chrome's signed-in Google profile."> <message name="IDS_SETTINGS_PEOPLE" desc="Name of the settings page which manages Chrome's signed-in Google profile.">
......
...@@ -130,6 +130,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() { ...@@ -130,6 +130,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
(*s_whitelist)["translate_blocked_languages"] = (*s_whitelist)["translate_blocked_languages"] =
settings_private::PrefType::PREF_TYPE_LIST; settings_private::PrefType::PREF_TYPE_LIST;
// Site Settings prefs.
(*s_whitelist)["profile.block_third_party_cookies"] =
settings_private::PrefType::PREF_TYPE_BOOLEAN;
// Clear browsing data settings. // Clear browsing data settings.
(*s_whitelist)["browser.clear_data.browsing_history"] = (*s_whitelist)["browser.clear_data.browsing_history"] =
settings_private::PrefType::PREF_TYPE_BOOLEAN; settings_private::PrefType::PREF_TYPE_BOOLEAN;
......
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
<template is="dom-if" name="site-settings-category-cookies"> <template is="dom-if" name="site-settings-category-cookies">
<settings-subpage page-title="$i18n{siteSettingsCategoryCookies}"> <settings-subpage page-title="$i18n{siteSettingsCategoryCookies}">
<site-settings-category <site-settings-category
prefs="{{prefs}}"
selected-site="{{selectedSite}}" selected-site="{{selectedSite}}"
current-route="{{currentRoute}}" current-route="{{currentRoute}}"
category="{{ContentSettingsTypes.COOKIES}}"> category="{{ContentSettingsTypes.COOKIES}}">
......
...@@ -50,6 +50,17 @@ ...@@ -50,6 +50,17 @@
<paper-toggle-button id="toggle" checked="{{categoryEnabled}}" <paper-toggle-button id="toggle" checked="{{categoryEnabled}}"
on-change="onToggleChange_"></paper-toggle-button> on-change="onToggleChange_"></paper-toggle-button>
</div> </div>
<div id="cookieControls" hidden>
<div class="settings-box">
<settings-checkbox class="start"
label="$i18n{thirdPartyCookie}"
sub-label="$i18n{thirdPartyCookieSublabel}"
pref="{{prefs.profile.block_third_party_cookies}}">
</settings-checkbox>
</div>
</div>
<settings-site-list id="blockList" <settings-site-list id="blockList"
category="[[category]]" category="[[category]]"
current-route="{{currentRoute}}" current-route="{{currentRoute}}"
......
...@@ -21,6 +21,14 @@ Polymer({ ...@@ -21,6 +21,14 @@ Polymer({
notify: true, notify: true,
}, },
/**
* Preferences state.
*/
prefs: {
type: Object,
notify: true,
},
/** /**
* Represents the state of the main toggle shown for the category. For * Represents the state of the main toggle shown for the category. For
* example, the Location category can be set to Block/Ask so false, in that * example, the Location category can be set to Block/Ask so false, in that
...@@ -56,6 +64,9 @@ Polymer({ ...@@ -56,6 +64,9 @@ Polymer({
this.addWebUIListener('contentSettingCategoryChanged', this.addWebUIListener('contentSettingCategoryChanged',
this.defaultValueForCategoryChanged_.bind(this)); this.defaultValueForCategoryChanged_.bind(this));
if (this.category == settings.ContentSettingsTypes.COOKIES)
this.$.cookieControls.hidden = false;
}, },
/** /**
......
...@@ -977,6 +977,9 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source) { ...@@ -977,6 +977,9 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source) {
{"siteSettingsPermissions", IDS_SETTINGS_SITE_SETTINGS_PERMISSIONS}, {"siteSettingsPermissions", IDS_SETTINGS_SITE_SETTINGS_PERMISSIONS},
{"siteSettingsClearAndReset", IDS_SETTINGS_SITE_SETTINGS_CLEAR_BUTTON}, {"siteSettingsClearAndReset", IDS_SETTINGS_SITE_SETTINGS_CLEAR_BUTTON},
{"siteSettingsDelete", IDS_SETTINGS_SITE_SETTINGS_DELETE}, {"siteSettingsDelete", IDS_SETTINGS_SITE_SETTINGS_DELETE},
{"thirdPartyCookie", IDS_SETTINGS_SITE_SETTINGS_THIRD_PARTY_COOKIE},
{"thirdPartyCookieSublabel",
IDS_SETTINGS_SITE_SETTINGS_THIRD_PARTY_COOKIE_SUBLABEL},
}; };
AddLocalizedStringsBulk(html_source, localized_strings, AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings)); arraysize(localized_strings));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment