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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/bubble.js

Issue 8565014: NTP4: Remove native focus emulation for bubbles when explictly told to. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « chrome/browser/resources/ntp4/new_tab.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/bubble.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/bubble.js b/chrome/browser/resources/shared/js/cr/ui/bubble.js
index f26b8bd8851338909829f2a57fb8aa6c6b2076be..439ce025e7a9631403de09f1fedc692a35a82e09 100644
--- a/chrome/browser/resources/shared/js/cr/ui/bubble.js
+++ b/chrome/browser/resources/shared/js/cr/ui/bubble.js
@@ -90,6 +90,17 @@ cr.define('cr.ui', function() {
this.handleCloseEvent_ = func;
},
+ captureFocus_: true,
Evan Stade 2011/11/14 19:20:52 meh, you can probably just assume this should alwa
Dan Beam 2011/11/15 04:15:10 Done.
+
+ /**
+ * Tells the bubble whether it should attempt to capture focus like native
+ * dialog UI (i.e. wrench menu).
+ * @param {boolean} capture Whether or not to capture focus.
+ */
+ set captureFocus(capture) {
+ this.captureFocus_ = !!capture;
+ },
+
/**
* Sets the anchor node, i.e. the node that this bubble points at.
* @param {HTMLElement} node The new anchor node.
@@ -227,8 +238,11 @@ cr.define('cr.ui', function() {
break;
}
- e.stopPropagation();
- e.preventDefault();
+ if (this.captureFocus_) {
+ e.stopPropagation();
+ e.preventDefault();
+ }
+
return;
},
};
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698