summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 14:49:53 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 14:49:53 +0000
commitdc7d38108db0e1821a807d6b56947ea6f130d3d1 (patch)
treec87fbb2ac608b955ee4b11c4a21ba5c043a20eb0
parentb0a2f0c8a46bafa7e3d47dfc05748d2dc71271eb (diff)
downloadchromium_src-dc7d38108db0e1821a807d6b56947ea6f130d3d1.zip
chromium_src-dc7d38108db0e1821a807d6b56947ea6f130d3d1.tar.gz
chromium_src-dc7d38108db0e1821a807d6b56947ea6f130d3d1.tar.bz2
Kill popups when scrolling.
BUG=http://crbug.com/17376 TEST=as in bug Review URL: http://codereview.chromium.org/155875 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21273 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 9457d28..6585c76 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -434,6 +434,22 @@ gfx::Rect RenderWidgetHostViewMac::GetRootWindowRect() {
}
- (void)scrollWheel:(NSEvent *)theEvent {
+ // On Windows, popups are implemented with a popup window style, so that when
+ // an event comes in that would "cancel" it, it receives the OnCancelMode
+ // message and can kill itself. Alas, on the Mac, views cannot capture events
+ // outside of themselves. While a click outside a popup kills it, that's just
+ // a defocusing of the text field in WebCore and our editor client kills the
+ // popup. But a scroll wheel event outside a popup must kill it.
+ //
+ // Thus this lovely case of filicide. If this view can be the key view, it is
+ // not a popup. Therefore, if it has any children, they are popups that need
+ // to be canceled.
+ if (canBeKeyView_) {
+ for (NSView* subview in [self subviews]) {
+ ((RenderWidgetHostViewCocoa*)subview)->renderWidgetHostView_->KillSelf();
+ }
+ }
+
const WebMouseWheelEvent& event =
WebInputEventFactory::mouseWheelEvent(theEvent, self);
if (renderWidgetHostView_->render_widget_host_)