summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/help/help_focus_manager.js
blob: 335f8fd6da77f9a3ffdd621256c69a65e846f6ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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.

// Helper class for help page, that controls focus transition between
// elements on the help page and overlays.
cr.define('help', function() {
  function HelpFocusManager() {
  }

  cr.addSingletonGetter(HelpFocusManager);

  HelpFocusManager.prototype = {
    __proto__: cr.ui.FocusManager.prototype,

    getFocusParent: function() {
      var page = help.HelpPage.getTopmostVisiblePage();
      if (!page)
        return null;
      return page.pageDiv;
    },
  };

  return {
    HelpFocusManager: HelpFocusManager,
  };
});