Commit 449afc0d authored by alekseys@chromium.org's avatar alekseys@chromium.org

Prevent focus from leaving Print Preview overlay controls.

BUG=276784

Review URL: https://codereview.chromium.org/400013003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284265 0039d316-1c4b-4281-b951-d872f2087c98
parent 9fb3fa20
......@@ -31,6 +31,7 @@
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/cr/ui/focus_manager.js"></script>
<script src="chrome://resources/js/cr/ui/focus_outline_manager.js"></script>
<script src="chrome://resources/js/event_tracker.js"></script>
<script src="chrome://resources/js/local_strings.js"></script>
......
......@@ -7,6 +7,7 @@
var localStrings = new LocalStrings(templateData);
<include src="component.js"/>
<include src="print_preview_focus_manager.js"/>
cr.define('print_preview', function() {
'use strict';
......@@ -255,6 +256,7 @@ cr.define('print_preview', function() {
this.setIsEnabled_(false);
}
this.nativeLayer_.startGetInitialSettings();
print_preview.PrintPreviewFocusManager.getInstance().initialize();
cr.ui.FocusOutlineManager.forDocument(document);
},
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
cr.define('print_preview', function() {
'use strict';
/**
* FocusManager implementation specialized for Print Preview, which ensures
* that Print Preview itself does not receive focus when an overlay is shown.
* @constructor
*/
function PrintPreviewFocusManager() {
};
cr.addSingletonGetter(PrintPreviewFocusManager);
PrintPreviewFocusManager.prototype = {
__proto__: cr.ui.FocusManager.prototype,
/** @override */
getFocusParent: function() {
return document.querySelector('.overlay:not([hidden])') ||
document.body;
}
};
// Export
return {
PrintPreviewFocusManager: PrintPreviewFocusManager
};
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment