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..405a460ed4f648e255d235bbe389f6dba58d9458 100644 |
--- a/chrome/browser/resources/extensions/extensions.js |
+++ b/chrome/browser/resources/extensions/extensions.js |
@@ -386,9 +386,16 @@ 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(); |
+ if (lastFocused && focusOutlineManager.visible) |
+ lastFocused.focus(); |
+ |
$('overlay').removeEventListener('cancelOverlay', f); |
}); |
node.classList.add('showing'); |