1 // Copyright (c) 2012 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('options', function() {
6 var FocusManager
= cr
.ui
.FocusManager
;
7 var PageManager
= cr
.ui
.pageManager
.PageManager
;
9 function OptionsFocusManager() {
12 cr
.addSingletonGetter(OptionsFocusManager
);
14 OptionsFocusManager
.prototype = {
15 __proto__
: FocusManager
.prototype,
18 getFocusParent: function() {
19 var topPage
= PageManager
.getTopmostVisiblePage().pageDiv
;
21 // The default page and search page include a search field that is a
22 // sibling of the rest of the page instead of a child. Thus, use the
23 // parent node to allow the search field to receive focus.
24 if (topPage
.parentNode
.id
== 'page-container')
25 return topPage
.parentNode
;
32 OptionsFocusManager
: OptionsFocusManager
,