diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-20 13:40:20 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-22 12:41:23 +0000 |
commit | 7961cea6d1041e3e454dae6a1da660b453efd238 (patch) | |
tree | c0eeb4a9ff9ba32986289c1653d9608e53ccb444 /chromium/chrome/browser/resources/settings/site_settings | |
parent | b7034d0803538058e5c9d904ef03cf5eab34f6ef (diff) |
BASELINE: Update Chromium to 78.0.3904.130
Change-Id: If185e0c0061b3437531c97c9c8c78f239352a68b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/resources/settings/site_settings')
15 files changed, 171 insertions, 13 deletions
diff --git a/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js b/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js index 12f8c830dbc..554bc6992dc 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js +++ b/chromium/chrome/browser/resources/settings/site_settings/category_default_setting.js @@ -126,6 +126,7 @@ Polymer({ case settings.ContentSettingsTypes.USB_DEVICES: case settings.ContentSettingsTypes.SERIAL_PORTS: case settings.ContentSettingsTypes.BLUETOOTH_SCANNING: + case settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE: // "Ask" vs "Blocked". this.browserProxy.setDefaultValueForContentType( this.category, diff --git a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html index 5164f1ceb8d..01d7cb15355 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html +++ b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html @@ -10,7 +10,8 @@ category-subtype="[[ContentSetting.BLOCK]]" category-header="[[blockHeader]]" read-only-list="[[readOnlyList]]" - search-filter="[[searchFilter]]"> + search-filter="[[searchFilter]]" + hidden$="[[!showBlockSiteList_]]"> </site-list> <site-list category="[[category]]" @@ -24,7 +25,8 @@ category-subtype="[[ContentSetting.ALLOW]]" category-header="$i18n{siteSettingsAllow}" read-only-list="[[readOnlyList]]" - search-filter="[[searchFilter]]"> + search-filter="[[searchFilter]]" + hidden$="[[!showAllowSiteList_]]"> </site-list> </template> <script src="category_setting_exceptions.js"></script> diff --git a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js index bff5aae0f21..212204450a9 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js +++ b/chromium/chrome/browser/resources/settings/site_settings/category_setting_exceptions.js @@ -11,6 +11,14 @@ Polymer({ is: 'category-setting-exceptions', properties: { + + /** + * The string ID of the category that this element is displaying data for. + * See site_settings/constants.js for possible values. + * @type {!settings.ContentSettingsTypes} + */ + category: String, + /** * Some content types (like Location) do not allow the user to manually * edit the exception list from within Settings. @@ -27,10 +35,38 @@ Polymer({ blockHeader: String, searchFilter: String, + + /** + * If true, displays the Allow site list. Defaults to true. + * @private + */ + showAllowSiteList_: { + type: Boolean, + computed: 'computeShowAllowSiteList_(category)', + }, + + /** + * If true, displays the Block site list. Defaults to true. + */ + showBlockSiteList_: { + type: Boolean, + value: true, + }, }, /** @override */ ready: function() { this.ContentSetting = settings.ContentSetting; }, + + /** + * Hides particular category subtypes if |this.category| does not support the + * content setting of that type. + * @return {boolean} + * @private + */ + computeShowAllowSiteList_: function() { + return this.category != + settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE; + }, }); diff --git a/chromium/chrome/browser/resources/settings/site_settings/constants.js b/chromium/chrome/browser/resources/settings/site_settings/constants.js index 909b06ff3b4..a7cf78b84ad 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/constants.js +++ b/chromium/chrome/browser/resources/settings/site_settings/constants.js @@ -37,6 +37,7 @@ settings.ContentSettingsTypes = { SENSORS: 'sensors', PAYMENT_HANDLER: 'payment-handler', BLUETOOTH_SCANNING: 'bluetooth-scanning', + NATIVE_FILE_SYSTEM_WRITE: 'native-file-system-write', }; /** diff --git a/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js b/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js index d4aec05be80..91289e40b9e 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js +++ b/chromium/chrome/browser/resources/settings/site_settings/cookie_info.js @@ -53,10 +53,6 @@ const cookieInfo = { ['origin', 'fileSystemOrigin'], ['persistent', 'fileSystemPersistentUsage'], ['temporary', 'fileSystemTemporaryUsage'] ], - 'channel_id': [ - ['serverId', 'channelIdServerId'], ['certType', 'channelIdType'], - ['created', 'channelIdCreated'] - ], 'service_worker': [['origin', 'serviceWorkerOrigin'], ['size', 'serviceWorkerSize']], 'shared_worker': diff --git a/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js b/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js index dee64f793b3..56112da2884 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js +++ b/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js @@ -97,6 +97,14 @@ cr.define('settings', function() { * @param {string} path The path to the parent cookie. */ removeCookie(path) {} + + /** + * Removes all SameSite=None cookies, as well as storage available in + * third-party contexts. + * Note: on-tree-item-removed will not be sent. + * @return {!Promise} To signal completion. + */ + removeAllThirdPartyCookies() {} } /** @@ -142,6 +150,11 @@ cr.define('settings', function() { removeCookie(path) { chrome.send('localData.removeCookie', [path]); } + + /** @override */ + removeAllThirdPartyCookies() { + return cr.sendWithPromise('localData.removeThirdPartyCookies'); + } } // The singleton instance_ is replaced with a test version of this wrapper diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data.html b/chromium/chrome/browser/resources/settings/site_settings/site_data.html index b3c8d9bf131..9fc485db610 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_data.html +++ b/chromium/chrome/browser/resources/settings/site_settings/site_data.html @@ -42,6 +42,11 @@ on-click="onRemoveShowingSitesTap_" hidden$="[[!sites.length]]"> [[computeRemoveLabel_(filter)]] </cr-button> + <cr-button disabled$="[[isLoading_]]" id="removeThirdPartyCookies" + on-click="onRemoveThirdPartyCookiesTap_" + hidden$="[[!enableRemovingAllThirdPartyCookies_]]"> + $i18n{siteSettingsCookieRemoveAllThirdParty} + </cr-button> </div> <iron-list id="list" items="[[sites]]" preserve-focus scroll-target="[[subpageScrollTarget]]" class="cr-separators"> @@ -71,6 +76,26 @@ </cr-button> </div> </cr-dialog> + + <!-- Confirm Delete Third Party Cookies dialog --> + <cr-dialog id="confirmDeleteThirdPartyDialog" close-text="$i18n{close}" + on-close="onConfirmDeleteThirdPartyDialogClosed_"> + <div slot="title"> + $i18n{siteSettingsCookieRemoveThirdPartyDialogTitle} + </div> + <div slot="body"> + $i18n{siteSettingsCookieRemoveThirdPartyConfirmation} + </div> + <div slot="button-container"> + <cr-button class="cancel-button" on-click="onCloseThirdPartyDialog_"> + $i18n{cancel} + </cr-button> + <cr-button class="action-button" on-click="onConfirmThirdPartyDelete_"> + $i18n{siteSettingsCookiesClearThirdParty} + </cr-button> + </div> + </cr-dialog> + </template> <script src="site_data.js"></script> </dom-module> diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data.js b/chromium/chrome/browser/resources/settings/site_settings/site_data.js index 06c8e742b30..644aedc4ac0 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_data.js +++ b/chromium/chrome/browser/resources/settings/site_settings/site_data.js @@ -75,6 +75,15 @@ Polymer({ /** @private */ listBlurred_: Boolean, + + /** @private */ + enableRemovingAllThirdPartyCookies_: { + type: Boolean, + value: function() { + return loadTimeData.getBoolean('enableRemovingAllThirdPartyCookies') && + (this.sites.length > 0); + } + }, }, /** @private {settings.LocalDataBrowserProxy} */ @@ -201,10 +210,20 @@ Polymer({ }, /** @private */ + onCloseThirdPartyDialog_: function() { + this.$.confirmDeleteThirdPartyDialog.close(); + }, + + /** @private */ onConfirmDeleteDialogClosed_: function() { cr.ui.focusWithoutInk(assert(this.$.removeShowingSites)); }, + /** @private */ + onConfirmDeleteThirdPartyDialogClosed_: function() { + cr.ui.focusWithoutInk(assert(this.$.removeAllThirdPartyCookies)); + }, + /** * Shows a dialog to confirm the deletion of multiple sites. * @param {!Event} e @@ -216,6 +235,16 @@ Polymer({ }, /** + * Shows a dialog to confirm the deletion of cookies available + * in third-party contexts and associated site data. + * @private + */ + onRemoveThirdPartyCookiesTap_: function(e) { + e.preventDefault(); + this.$.confirmDeleteThirdPartyDialog.showModal(); + }, + + /** * Called when deletion for all showing sites has been confirmed. * @private */ @@ -233,6 +262,18 @@ Polymer({ }, /** + * Called when deletion of all third-party cookies and site data has been + * confirmed. + * @private + */ + onConfirmThirdPartyDelete_: function() { + this.$.confirmDeleteThirdPartyDialog.close(); + this.browserProxy_.removeAllThirdPartyCookies().then(() => { + this.updateSiteList_(); + }); + }, + + /** * @param {!{model: !{item: CookieDataSummaryItem, index: number}}} event * @private */ diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js b/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js index f862bba40e6..37ca12214f4 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js +++ b/chromium/chrome/browser/resources/settings/site_settings/site_data_details_subpage.js @@ -8,7 +8,6 @@ const categoryLabels = { app_cache: loadTimeData.getString('cookieAppCache'), cache_storage: loadTimeData.getString('cookieCacheStorage'), - channel_id: loadTimeData.getString('cookieChannelId'), database: loadTimeData.getString('cookieDatabaseStorage'), file_system: loadTimeData.getString('cookieFileSystem'), flash_lso: loadTimeData.getString('cookieFlashLso'), diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details.html b/chromium/chrome/browser/resources/settings/site_settings/site_details.html index 5b373ff071c..1472652cc9e 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_details.html +++ b/chromium/chrome/browser/resources/settings/site_settings/site_details.html @@ -178,6 +178,13 @@ label="$i18n{siteSettingsSerialPorts}"> </site-details-permission> </template> + <template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]"> + <site-details-permission + category="{{ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE}}" + icon="settings:save-original" id="nativeFileSystemWrite" + label="$i18n{siteSettingsNativeFileSystemWrite}"> + </site-details-permission> + </template> <site-details-permission category="{{ContentSettingsTypes.UNSANDBOXED_PLUGINS}}" icon="cr:extension" id="unsandboxedPlugins" diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details.js b/chromium/chrome/browser/resources/settings/site_settings/site_details.js index da034ee588f..875533a5f19 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_details.js +++ b/chromium/chrome/browser/resources/settings/site_settings/site_details.js @@ -69,6 +69,15 @@ Polymer({ return loadTimeData.getBoolean('enableBluetoothScanningContentSetting'); } }, + + /** @private */ + enableNativeFileSystemWriteContentSetting_: { + type: Boolean, + value: function() { + return loadTimeData.getBoolean( + 'enableNativeFileSystemWriteContentSetting'); + } + }, }, listeners: { diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js index 88b55c9ce59..76f870645d2 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js +++ b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js @@ -230,7 +230,8 @@ Polymer({ return !( category == settings.ContentSettingsTypes.SERIAL_PORTS || category == settings.ContentSettingsTypes.USB_DEVICES || - category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING); + category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING || + category == settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE); }, /** @@ -248,8 +249,10 @@ Polymer({ return true; } - // For Bluetooth scanning permission 'ask' takes the place of 'allow'. - if (category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING) { + // For Bluetooth scanning permission and Native File System write permission + // 'ask' takes the place of 'allow'. + if (category == settings.ContentSettingsTypes.BLUETOOTH_SCANNING || + category == settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE) { return true; } diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list.html b/chromium/chrome/browser/resources/settings/site_settings/site_list.html index a07b8c00068..de095c0574e 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_list.html +++ b/chromium/chrome/browser/resources/settings/site_settings/site_list.html @@ -33,7 +33,7 @@ <div class="settings-box first"> <h2 class="start">[[categoryHeader]]</h2> <cr-button id="addSite" class="header-aligned-button" - hidden="[[readOnlyList]]" on-click="onAddSiteTap_"> + hidden$="[[!showAddSiteButton_]]" on-click="onAddSiteTap_"> $i18n{add} </cr-button> </div> diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list.js b/chromium/chrome/browser/resources/settings/site_settings/site_list.js index 5e9cbba9943..bdc541bd8a9 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_list.js +++ b/chromium/chrome/browser/resources/settings/site_settings/site_list.js @@ -65,6 +65,16 @@ Polymer({ /** @private */ hasIncognito_: Boolean, + /** + * Whether to show the Add button next to the header. + * @private + */ + showAddSiteButton_: { + type: Boolean, + computed: 'computeShowAddSiteButton_(readOnlyList, category, ' + + 'categorySubtype)', + }, + /** @private */ showAddSiteDialog_: Boolean, @@ -222,6 +232,20 @@ Polymer({ }, /** + * Whether the Add Site button is shown in the header for the current category + * and category subtype. + * @return {boolean} + * @private + */ + computeShowAddSiteButton_: function() { + return !( + this.readOnlyList || + (this.category == + settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE && + this.categorySubtype == settings.ContentSetting.ALLOW)); + }, + + /** * @return {boolean} * @private */ diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js b/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js index 9b3234d09ff..af45a352e33 100644 --- a/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js +++ b/chromium/chrome/browser/resources/settings/site_settings/site_settings_behavior.js @@ -193,8 +193,6 @@ const SiteSettingsBehaviorImpl = { }; // These categories are gated behind flags. addOrRemoveSettingWithFlag( - settings.ContentSettingsTypes.SENSORS, 'enableSensorsContentSetting'); - addOrRemoveSettingWithFlag( settings.ContentSettingsTypes.SERIAL_PORTS, 'enableExperimentalWebPlatformFeatures'); addOrRemoveSettingWithFlag( @@ -206,6 +204,9 @@ const SiteSettingsBehaviorImpl = { addOrRemoveSettingWithFlag( settings.ContentSettingsTypes.BLUETOOTH_SCANNING, 'enableBluetoothScanningContentSetting'); + addOrRemoveSettingWithFlag( + settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE, + 'enableNativeFileSystemWriteContentSetting'); return this.contentTypes_.slice(0); }, |