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

Unified Diff: chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js

Issue 2789783002: MD Settings: Restore focus after closing dialogs, for passwords page. (Closed)
Patch Set: fix compilation Created 3 years, 9 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
« no previous file with comments | « chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
index c4e9640894142e1fa91c0321e823429ac25fcdca..ea247205be16177c978995dc91fb153564078e86 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
@@ -216,6 +216,13 @@ Polymer({
},
/**
+ * The element to return focus to, when the currently active dialog is
+ * closed.
+ * @private {?HTMLElement}
+ */
+ activeDialogAnchor_: null,
+
+ /**
* @type {PasswordManager}
* @private
*/
@@ -298,6 +305,8 @@ Polymer({
/** @private */
onPasswordEditDialogClosed_: function() {
this.showPasswordEditDialog_ = false;
+ this.activeDialogAnchor_.focus();
+ this.activeDialogAnchor_ = null;
},
/**
@@ -361,13 +370,14 @@ Polymer({
*/
onPasswordMenuTap_: function(e) {
var menu = /** @type {!CrActionMenuElement} */(this.$.menu);
- var target = /** @type {!Element} */(Polymer.dom(e).localTarget);
+ var target = /** @type {!HTMLElement} */(Polymer.dom(e).localTarget);
var passwordUiEntryEvent = /** @type {!PasswordUiEntryEvent} */(e);
this.activePassword =
/** @type {!chrome.passwordsPrivate.PasswordUiEntry} */ (
passwordUiEntryEvent.model.item);
menu.showAt(target);
+ this.activeDialogAnchor_ = target;
},
/**
« no previous file with comments | « chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698