Add ENABLE_MEDIA_ROUTER define to builds other than Android and iOS.
[chromium-blink-merge.git] / chrome / browser / resources / options / options_focus_manager.js
blob9fc3f21a99a8b1a1baa690925b388fb18f325b16
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,
17 /** @override */
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;
27 return topPage;
31 return {
32 OptionsFocusManager: OptionsFocusManager,
34 });