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

Unified Diff: chrome/browser/resources/extensions/extension_options_overlay.js

Issue 862403006: extensions: fix focus management for all dialogs (not just options). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@classList-fix
Patch Set: toggle Created 5 years, 10 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/extensions/extension_options_overlay.js
diff --git a/chrome/browser/resources/extensions/extension_options_overlay.js b/chrome/browser/resources/extensions/extension_options_overlay.js
index eb15741494d56b13a29cacee6ee97211b873681a..e97bf1a8250a29f0287f5dac41d894fc03e7f05f 100644
--- a/chrome/browser/resources/extensions/extension_options_overlay.js
+++ b/chrome/browser/resources/extensions/extension_options_overlay.js
@@ -44,7 +44,10 @@ cr.define('extensions', function() {
this.getExtensionOptions_().focus();
},
- /** @return {?Element} */
+ /**
+ * @return {?Element}
+ * @private
+ */
getExtensionOptions_: function() {
return $('extension-options-overlay-guest').querySelector(
'extensionoptions');
@@ -74,8 +77,8 @@ cr.define('extensions', function() {
* @param {string} extensionName The name of the extension, which is used
* as the header of the overlay.
* @param {string} extensionIcon The URL of the extension's icon.
- * @param {function():void} shownCallback A function called when show
- * animation completes.
+ * @param {function():void} shownCallback A function called when
+ * showing completes.
* @suppress {checkTypes}
* TODO(vitalyp): remove the suppression after adding
* chrome/renderer/resources/extensions/extension_options.js
@@ -93,8 +96,6 @@ cr.define('extensions', function() {
$('extension-options-overlay-title').textContent = extensionName;
$('extension-options-overlay-icon').src = extensionIcon;
- this.setVisible_(true);
-
var extensionoptions = new window.ExtensionOptions();
extensionoptions.extension = extensionId;
@@ -178,6 +179,9 @@ cr.define('extensions', function() {
overlayGuest.style.height = '';
overlayGuest.appendChild(extensionoptions);
+
+ // Show the dialog after extensionoptions is in the DOM so it gets focus.
+ this.setVisible_(true);
not at google - send to devlin 2015/02/06 21:31:38 Unfortunately showing the overlay early serves a p
Dan Beam 2015/02/06 21:50:02 i don't ;), moved back
},
/**

Powered by Google App Engine
This is Rietveld 408576698