Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1694)

Unified Diff: chrome/browser/resources/settings/site_settings/site_details.js

Issue 2391253002: Site Settings Desktop: Polish the Site Data section. (Closed)
Patch Set: Address feedback Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/site_settings/site_details.js
diff --git a/chrome/browser/resources/settings/site_settings/site_details.js b/chrome/browser/resources/settings/site_settings/site_details.js
index 125e163823c78e5909ef384cb2f232859cacffdd..b0ae37060a7091e2f3d2131b9be39701f0b59bd3 100644
--- a/chrome/browser/resources/settings/site_settings/site_details.js
+++ b/chrome/browser/resources/settings/site_settings/site_details.js
@@ -24,6 +24,7 @@ Polymer({
/**
* The amount of data stored for the origin.
+ * @private
*/
storedData_: {
type: String,
@@ -32,8 +33,12 @@ Polymer({
/**
* The type of storage for the origin.
+ * @private
*/
storageType_: Number,
+
+ /** @private */
+ confirmationDeleteMsg_: String,
},
listeners: {
@@ -60,6 +65,7 @@ Polymer({
/**
* Handler for when the origin changes.
+ * @private
*/
onSiteChanged_: function() {
// originForDisplay may be initially undefined if the user follows a direct
@@ -71,8 +77,26 @@ Polymer({
}
},
+ /** @private */
+ onCloseDialog_: function() {
+ this.$.confirmDeleteDialog.close();
+ },
+
+ /**
+ * Confirms the deletion of storage for a site.
+ * @param {!{model: !{item: CookieDataSummaryItem}}} event
+ * @private
+ */
+ onConfirmClearStorage_: function(event) {
dschuyler 2016/10/07 21:14:49 Optional: it seems common to leave off the paramet
Finnur 2016/10/10 09:56:55 Removed.
+ this.confirmationDeleteMsg_ = loadTimeData.getStringF(
+ 'siteSettingsSiteRemoveConfirmation',
+ this.toUrl(this.site.origin).href);
+ this.$.confirmDeleteDialog.showModal();
+ },
+
/**
* Clears all data stored for the current origin.
+ * @private
*/
onClearStorage_: function() {
this.$.usageApi.clearUsage(
@@ -81,6 +105,7 @@ Polymer({
/**
* Called when usage has been deleted for an origin.
+ * @private
dschuyler 2016/10/07 21:14:49 @param ... event and: Should the function have a
Finnur 2016/10/10 09:56:55 Added @param and trailing underscore.
*/
onUsageDeleted: function(event) {
if (event.detail.origin == this.toUrl(this.site.origin).href) {
@@ -91,6 +116,7 @@ Polymer({
/**
* Resets all permissions and clears all data stored for the current origin.
+ * @private
*/
onClearAndReset_: function() {
Array.prototype.forEach.call(
@@ -105,6 +131,7 @@ Polymer({
/**
* Navigate back if the UI is empty (everything been cleared).
+ * @private
*/
navigateBackIfNoData_: function() {
if (this.storedData_ == '' && !this.permissionShowing_())
@@ -113,6 +140,7 @@ Polymer({
/**
* Returns true if one or more permission is showing.
+ * @private
*/
permissionShowing_: function() {
return Array.prototype.some.call(

Powered by Google App Engine
This is Rietveld 408576698