Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 cr.define('extensions', function() { | |
| 6 var FocusManager = cr.ui.FocusManager; | |
| 7 | |
| 8 function ExtensionFocusManager() { | |
| 9 } | |
| 10 | |
| 11 cr.addSingletonGetter(ExtensionFocusManager); | |
| 12 | |
| 13 ExtensionFocusManager.prototype = { | |
| 14 __proto__: FocusManager.prototype, | |
| 15 | |
| 16 /** | |
| 17 * Returns the parent element containing all elements which should be | |
| 18 * allowed to receive focus. | |
| 19 * @return {Element} The element containing focusable elements. | |
| 20 */ | |
| 21 getFocusParent: function() { | |
| 22 var overlay = extensions.ExtensionSettings.getCurrentOverlay(); | |
| 23 return overlay ? overlay : $('extension-settings'); | |
|
Evan Stade
2012/05/31 17:02:00
you can just do
return overlay || $('extension-
Kyle Horimoto
2012/06/01 00:02:43
Done.
| |
| 24 }, | |
| 25 }; | |
| 26 | |
| 27 return { | |
| 28 ExtensionFocusManager: ExtensionFocusManager, | |
| 29 }; | |
| 30 }); | |
| OLD | NEW |