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

Unified Diff: ui/webui/resources/js/cr/ui/page_manager/page_manager.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: kalman@ review 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
« no previous file with comments | « ui/webui/resources/js/cr/ui/page_manager/page.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/page_manager/page_manager.js
diff --git a/ui/webui/resources/js/cr/ui/page_manager/page_manager.js b/ui/webui/resources/js/cr/ui/page_manager/page_manager.js
index 8220c2cc7af419e126e9f9563c776a6aad52fe50..ae6283a8c019a587914e1b56054ab7686f44454e 100644
--- a/ui/webui/resources/js/cr/ui/page_manager/page_manager.js
+++ b/ui/webui/resources/js/cr/ui/page_manager/page_manager.js
@@ -3,8 +3,6 @@
// found in the LICENSE file.
cr.define('cr.ui.pageManager', function() {
- /** @const */ var FocusOutlineManager = cr.ui.FocusOutlineManager;
-
/**
* PageManager contains a list of root Page and overlay Page objects and
* handles "navigation" by showing and hiding these pages and overlays. On
@@ -56,7 +54,7 @@ cr.define('cr.ui.pageManager', function() {
initialize: function(defaultPage) {
this.defaultPage_ = defaultPage;
- FocusOutlineManager.forDocument(document);
+ cr.ui.FocusOutlineManager.forDocument(document);
document.addEventListener('scroll', this.handleScroll_.bind(this));
// Trigger the scroll handler manually to set the initial state.
@@ -500,11 +498,10 @@ cr.define('cr.ui.pageManager', function() {
// Change focus to the overlay if any other control was focused by
// keyboard before. Otherwise, no one should have focus.
if (document.activeElement != document.body) {
- if (FocusOutlineManager.forDocument(document).visible) {
+ if (cr.ui.FocusOutlineManager.forDocument(document).visible)
overlay.focus();
- } else if (!overlay.pageDiv.contains(document.activeElement)) {
+ if (!overlay.pageDiv.contains(document.activeElement))
document.activeElement.blur();
- }
}
if ($('search-field') && $('search-field').value == '') {
« no previous file with comments | « ui/webui/resources/js/cr/ui/page_manager/page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698