// Copyright 2013 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.

var FocusManager = cr.ui.FocusManager;

/**
 * A history-specific FocusManager implementation, which ensures that elements
 * "background" pages (i.e., those in a dialog that is not the topmost overlay)
 * do not receive focus.
 * @constructor
 */
function HistoryFocusManager() {
}

cr.addSingletonGetter(HistoryFocusManager);

HistoryFocusManager.prototype = {
  __proto__: FocusManager.prototype,

  /** @override */
  getFocusParent: function() {
    return document.querySelector('#overlay .showing') || $('history-page');
  },
};

// Copyright 2013 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.

var FocusManager = cr.ui.FocusManager;

/**
 * A history-specific FocusManager implementation, which ensures that elements
 * "background" pages (i.e., those in a dialog that is not the topmost overlay)
 * do not receive focus.
 * @constructor
 */
function HistoryFocusManager() {
}

cr.addSingletonGetter(HistoryFocusManager);

HistoryFocusManager.prototype = {
  __proto__: FocusManager.prototype,

  /** @override */
  getFocusParent: function() {
    return document.querySelector('#overlay .showing') ||
        document.querySelector('menu:not([hidden])') ||
        $('history-page');
  },
};

Fix problem with space bar not causing the menu to appear.
History: Fix problem with space bar not causing the menu to appear.

When a history entry's dropdown menu is focused, hitting the space
bar should cause the menu to appear.

BUG=268334

Review URL: https://chromiumcodereview.appspot.com/22464009

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@216677 0039d316-1c4b-4281-b951-d872f2087c98
