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

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

Issue 2180823004: Migrate <cr-dialog> from PaperDialogBehavior to native <dialog>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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 c9388e54651b9b272f606b3a194ce7b40e60d7f0..9af5239d8fbdb3a63788baa984b6aa06bb2e2b79 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
@@ -53,11 +53,12 @@ Polymer({
this.populateDialog_();
this.listener_ = cr.addWebUIListener(
'onTreeItemRemoved', this.onTreeItemRemoved_.bind(this));
- this.$.dialog.open();
+ this.$.dialog.showModal();
},
/**
* Populates the dialog with the data about the site.
+ * @private
*/
populateDialog_: function() {
this.title_ = loadTimeData.getStringF('siteSettingsCookieDialog',
@@ -84,6 +85,7 @@ Polymer({
* @param {string} currentPath The path constructed so far.
* @param {string} targetId The id of the target leaf node to look for.
* @return {string} The path of the node returned (or blank if not found).
+ * @private
*/
nodePath_: function(node, currentPath, targetId) {
if (node.data_.id == targetId)
@@ -104,6 +106,7 @@ Polymer({
* Add the cookie data to the content section of this dialog.
* @param {string} id The id of the cookie node to display.
* @param {!settings.CookieTreeNode} site The current site.
+ * @private
*/
populateItem_: function(id, site) {
// Out with the old...
@@ -118,6 +121,7 @@ Polymer({
site.addCookieData(root, node);
},
+ /** @private */
onTreeItemRemoved_: function(args) {
this.entries_ = this.site_.getCookieList();
if (args[0] == this.site_.data_.id || this.entries_.length == 0) {
@@ -134,6 +138,7 @@ Polymer({
/**
* A handler for when the user changes the dropdown box (switches cookies).
+ * @private
*/
onItemSelected_: function(event) {
this.populateItem_(event.detail.selected, this.site_);
@@ -150,6 +155,7 @@ Polymer({
/**
* A handler for when the user opts to remove a single cookie.
+ * @private
*/
onRemove_: function(event) {
this.browserProxy.removeCookie(this.nodePath_(
@@ -158,9 +164,16 @@ Polymer({
/**
* A handler for when the user opts to remove all cookies.
+ * @private
*/
onRemoveAll_: function(event) {
cr.removeWebUIListener(this.listener_);
this.browserProxy.removeCookie(this.site_.data_.id);
+ this.$.dialog.close();
+ },
+
+ /** @private */
+ onCancelTap_: function() {
+ this.$.dialog.cancel();
},
});

Powered by Google App Engine
This is Rietveld 408576698