• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2013 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.
4
5var FocusManager = cr.ui.FocusManager;
6
7/**
8 * A history-specific FocusManager implementation, which ensures that elements
9 * "background" pages (i.e., those in a dialog that is not the topmost overlay)
10 * do not receive focus.
11 * @constructor
12 */
13function HistoryFocusManager() {
14}
15
16cr.addSingletonGetter(HistoryFocusManager);
17
18HistoryFocusManager.prototype = {
19  __proto__: FocusManager.prototype,
20
21  /** @override */
22  getFocusParent: function() {
23    return document.querySelector('#overlay .showing') ||
24        document.querySelector('menu:not([hidden])') ||
25        $('history-page');
26  },
27};
28