Chromium Code Reviews| Index: chrome/browser/views/browser_actions_container.cc |
| =================================================================== |
| --- chrome/browser/views/browser_actions_container.cc (revision 33297) |
| +++ chrome/browser/views/browser_actions_container.cc (working copy) |
| @@ -459,10 +459,24 @@ |
| popup_->host()->render_view_host()->view()->Focus(); |
| } |
| -void BrowserActionsContainer::BubbleLostFocus(BrowserBubble* bubble) { |
| +void BrowserActionsContainer::BubbleLostFocus(BrowserBubble* bubble, |
| + gfx::NativeView focused_view) { |
| if (!popup_) |
| return; |
| +#if defined(OS_WIN) |
| + // Don't hide when we are loosing focus to a child window. This is the case |
| + // with select popups. |
| + // TODO(jcampan): http://crbugs.com/29131 make that work on toolkit views |
|
Erik does not do reviews
2009/12/02 01:26:11
typo: crbug.com
|
| + // so this #if defined can be removed. |
| + gfx::NativeView popup_native_view = popup_->native_view(); |
| + gfx::NativeView parent = focused_view; |
| + while (parent = ::GetParent(parent)) { |
| + if (parent == popup_native_view) |
| + return; |
| + } |
| +#endif |
| + |
| // This is a bit annoying. If you click on the button that generated the |
| // current popup, then we first get this lost focus message, and then |
| // we get the click action. This results in the popup being immediately |