Chromium Code Reviews| Index: chrome/browser/resources/extensions/extension_focus_manager.js |
| diff --git a/chrome/browser/resources/extensions/extension_focus_manager.js b/chrome/browser/resources/extensions/extension_focus_manager.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e3eb038450ad924c021882b42592991077d96773 |
| --- /dev/null |
| +++ b/chrome/browser/resources/extensions/extension_focus_manager.js |
| @@ -0,0 +1,30 @@ |
| +// Copyright (c) 2012 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. |
| + |
| +cr.define('extensions', function() { |
| + var FocusManager = cr.ui.FocusManager; |
| + |
| + function ExtensionFocusManager() { |
| + } |
| + |
| + cr.addSingletonGetter(ExtensionFocusManager); |
| + |
| + ExtensionFocusManager.prototype = { |
| + __proto__: FocusManager.prototype, |
| + |
| + /** |
| + * Returns the parent element containing all elements which should be |
| + * allowed to receive focus. |
| + * @return {Element} The element containing focusable elements. |
| + */ |
| + getFocusParent: function() { |
| + var overlay = extensions.ExtensionSettings.getCurrentOverlay(); |
| + 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.
|
| + }, |
| + }; |
| + |
| + return { |
| + ExtensionFocusManager: ExtensionFocusManager, |
| + }; |
| +}); |