Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: chrome/browser/resources/options/options_focus_manager.js

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed feedback Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('options', function() { 5 cr.define('options', function() {
6 var FocusManager = cr.ui.FocusManager; 6 var FocusManager = cr.ui.FocusManager;
7 var OptionsPage = options.OptionsPage; 7 var PageManager = cr.ui.pageManager.PageManager;
8 8
9 function OptionsFocusManager() { 9 function OptionsFocusManager() {
10 } 10 }
11 11
12 cr.addSingletonGetter(OptionsFocusManager); 12 cr.addSingletonGetter(OptionsFocusManager);
13 13
14 OptionsFocusManager.prototype = { 14 OptionsFocusManager.prototype = {
15 __proto__: FocusManager.prototype, 15 __proto__: FocusManager.prototype,
16 16
17 /** @override */ 17 /** @override */
18 getFocusParent: function() { 18 getFocusParent: function() {
19 var topPage = OptionsPage.getTopmostVisiblePage().pageDiv; 19 var topPage = PageManager.getTopmostVisiblePage().pageDiv;
20 20
21 // The default page and search page include a search field that is a 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 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. 23 // parent node to allow the search field to receive focus.
24 if (topPage.parentNode.id == 'page-container') 24 if (topPage.parentNode.id == 'page-container')
25 return topPage.parentNode; 25 return topPage.parentNode;
26 26
27 return topPage; 27 return topPage;
28 }, 28 },
29 }; 29 };
30 30
31 return { 31 return {
32 OptionsFocusManager: OptionsFocusManager, 32 OptionsFocusManager: OptionsFocusManager,
33 }; 33 };
34 }); 34 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698