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

Unified Diff: chrome/browser/resources/print_preview/print_preview_focus_manager.js

Issue 400013003: Prevent focus from leaving Print Preview overlay controls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « chrome/browser/resources/print_preview/print_preview.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/print_preview_focus_manager.js
diff --git a/chrome/browser/resources/print_preview/print_preview_focus_manager.js b/chrome/browser/resources/print_preview/print_preview_focus_manager.js
new file mode 100644
index 0000000000000000000000000000000000000000..fd2408753336c24653555dd3fba21ab88943b87a
--- /dev/null
+++ b/chrome/browser/resources/print_preview/print_preview_focus_manager.js
@@ -0,0 +1,32 @@
+// 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
+ };
+});
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698