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

Unified Diff: chrome/browser/resources/extensions/extension_focus_manager.js

Issue 10444100: Implements a focus manager for the extensions page. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Changed getFocusParent() to a public function. Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/extensions/extensions.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
+ };
+});
« no previous file with comments | « no previous file | chrome/browser/resources/extensions/extensions.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698