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'); |