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

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

Issue 1162293008: Fix some lingering WebUI focus issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not more or less hacky, just hacky in a different way... Created 5 years, 6 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/extensions.js
diff --git a/chrome/browser/resources/extensions/extensions.js b/chrome/browser/resources/extensions/extensions.js
index 3dc9635ade7674f3a669872e8ec044e4ddb3576b..d50ceb370a7e703728f52c22fe6570ddaa8f4ab4 100644
--- a/chrome/browser/resources/extensions/extensions.js
+++ b/chrome/browser/resources/extensions/extensions.js
@@ -386,9 +386,19 @@ cr.define('extensions', function() {
}
if (node) {
- var lastFocused = document.activeElement;
+ var lastFocused;
+
+ var focusOutlineManager = cr.ui.FocusOutlineManager.forDocument(document);
+ if (focusOutlineManager.visible)
+ lastFocused = document.activeElement;
+
$('overlay').addEventListener('cancelOverlay', function f() {
- lastFocused.focus();
+ console.log('cancelOverlay');
+ console.log('lastFocused', lastFocused);
+ console.log('focusOutlineManager.visible', focusOutlineManager.visible);
Dan Beam 2015/08/11 02:31:41 ^ oops
+ if (lastFocused && focusOutlineManager.visible)
+ lastFocused.focus();
+
$('overlay').removeEventListener('cancelOverlay', f);
});
node.classList.add('showing');

Powered by Google App Engine
This is Rietveld 408576698