Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / resources / print_preview / print_preview_focus_manager.js
blobbe4c22d06d01465d20fd834892e476bf2577a109
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 cr.define('print_preview', function() {
6   'use strict';
8   /**
9    * FocusManager implementation specialized for Print Preview, which ensures
10    * that Print Preview itself does not receive focus when an overlay is shown.
11    * @constructor
12    * @extends {cr.ui.FocusManager}
13    */
14   function PrintPreviewFocusManager() {
15   };
17   cr.addSingletonGetter(PrintPreviewFocusManager);
19   PrintPreviewFocusManager.prototype = {
20     __proto__: cr.ui.FocusManager.prototype,
22     /** @override */
23     getFocusParent: function() {
24       return document.querySelector('.overlay:not([hidden])') ||
25           document.body;
26     }
27   };
29   // Export
30   return {
31     PrintPreviewFocusManager: PrintPreviewFocusManager
32   };
33 });