Chromium Code Reviews| 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; |
| }, |
| }; |