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

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

Issue 900623003: extensions: focus options overlay content when shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy-icon-label
Patch Set: merge Created 5 years, 11 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_list.js
diff --git a/chrome/browser/resources/extensions/extension_list.js b/chrome/browser/resources/extensions/extension_list.js
index b8ab0d4a66a37583a7a6017dad241355cc6a3d44..580dfe6c4b11aaf37df8d5ac6bb44af93144239e 100644
--- a/chrome/browser/resources/extensions/extension_list.js
+++ b/chrome/browser/resources/extensions/extension_list.js
@@ -567,20 +567,35 @@ cr.define('options', function() {
if (scroll)
this.scrollToNode_(extensionId);
+
// Add the options query string. Corner case: the 'options' query string
// will clobber the 'id' query string if the options link is clicked when
// 'id' is in the URL, or if both query strings are in the URL.
uber.replaceState({}, '?options=' + extensionId);
- extensions.ExtensionOptionsOverlay.getInstance().
- setExtensionAndShowOverlay(extensionId,
- extension.name,
- extension.icon);
-
+ var overlay = extensions.ExtensionOptionsOverlay.getInstance();
+ overlay.setExtensionAndShowOverlay(extensionId, extension.name,
+ extension.icon);
this.optionsShown_ = true;
- $('overlay').addEventListener('cancelOverlay', function() {
- this.optionsShown_ = false;
- }.bind(this));
+
+ if (cr.ui.FocusOutlineManager.forDocument(document).visible)
+ overlay.setInitialFocus();
+ else
+ document.activeElement.blur();
+
+ var self = this;
+
+ $('overlay').addEventListener('animationFinished', function f() {
not at google - send to devlin 2015/02/03 20:52:04 Consider commenting that the animation is started
Dan Beam 2015/02/04 17:15:38 Done.
+ overlay.setInitialFocus();
+ $('overlay').removeEventListener('animationFinished', f);
+ });
+
+ $('overlay').addEventListener('cancelOverlay', function f() {
+ // Restore initial focus once this page isn't rebuild crazy.
+ // http://crbug.com/450818
+ self.optionsShown_ = false;
+ $('overlay').removeEventListener('cancelOverlay', f);
+ });
},
};

Powered by Google App Engine
This is Rietveld 408576698