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

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

Issue 2379913003: Site Settings Desktop: Polish the Site Data details dialog. (Closed)
Patch Set: Created 4 years, 3 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_data_details_dialog.js
diff --git a/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js b/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js
index 1bf1018d81c7ef49e0b2cf70fa0678a4b431faa4..477dcca7a04968aa331bb1bbb75d6b650618f5c4 100644
--- a/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js
+++ b/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js
@@ -57,6 +57,23 @@ Polymer({
},
/**
+ * Closes the dialog, if open.
+ */
+ close: function() {
+ var dialog = this.getDialog_();
+ if (dialog.open)
+ dialog.close();
+ },
+
+ /**
+ * @return {!CrDialogElement}
+ * @private
+ */
+ getDialog_: function() {
+ return /** @type {!CrDialogElement} */ (this.$.dialog);
+ },
Finnur 2016/09/29 15:54:01 This was also not mentioned in the bug, but discov
dschuyler 2016/09/29 19:40:27 I think this can be inlined above like: var dia
Finnur 2016/09/30 09:19:43 Done, with minor modifications. :)
+
+ /**
* Populates the dialog with the data about the site.
* @private
*/
@@ -128,8 +145,8 @@ Polymer({
*/
onTreeItemRemoved_: function(args) {
this.entries_ = this.site_.getCookieList();
- if (args.id == this.site_.data_.id || this.entries_.length == 0) {
- this.$.dialog.close();
+ if (this.site_.children_.length == 0 || this.entries_.length == 0) {
Finnur 2016/09/29 15:54:01 This is to fix the bug with the dialog closing pre
dschuyler 2016/09/29 19:40:27 Acknowledged.
+ this.close();
return;
}
@@ -183,7 +200,7 @@ Polymer({
onRemoveAll_: function(event) {
cr.removeWebUIListener(this.listener_);
this.browserProxy.removeCookie(this.site_.data_.id);
- this.$.dialog.close();
+ this.close();
},
/** @private */

Powered by Google App Engine
This is Rietveld 408576698