diff options
Diffstat (limited to 'chrome/browser/renderer_host')
5 files changed, 14 insertions, 10 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 44c0023..421615f 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1277,8 +1277,8 @@ void RenderViewHost::UnhandledKeyboardEvent( } } -void RenderViewHost::OnEnterOrSpace() { - delegate_->OnEnterOrSpace(); +void RenderViewHost::OnUserGesture() { + delegate_->OnUserGesture(); } void RenderViewHost::OnMissingPluginStatus(int status) { diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 9c08f11..c28af30 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -434,7 +434,7 @@ class RenderViewHost : public RenderWidgetHost { protected: // RenderWidgetHost protected overrides. virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); - virtual void OnEnterOrSpace(); + virtual void OnUserGesture(); virtual void NotifyRendererUnresponsive(); virtual void NotifyRendererResponsive(); diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 75a80d4..7668b9c 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -421,10 +421,10 @@ class RenderViewHostDelegate { int32 page_id, const webkit_glue::WebApplicationInfo& app_info) { } - // Notification the user has pressed enter or space while focus was on the + // Notification the user has made a gesture while focus was on the // page. This is used to avoid uninitiated user downloads (aka carpet // bombing), see DownloadRequestManager for details. - virtual void OnEnterOrSpace() { } + virtual void OnUserGesture() { } // If this view is used to host an external tab container. virtual bool IsExternalTabContainer() const { return false; } diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 9e196e9..36e6085 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -301,6 +301,8 @@ void RenderWidgetHost::ForwardMouseEvent(const WebMouseEvent& mouse_event) { return; } mouse_move_pending_ = true; + } else if (mouse_event.type == WebInputEvent::MouseDown) { + OnUserGesture(); } ForwardInputEvent(mouse_event, sizeof(WebMouseEvent)); @@ -316,7 +318,7 @@ void RenderWidgetHost::ForwardKeyboardEvent( if (key_event.type == WebKeyboardEvent::Char && (key_event.windowsKeyCode == base::VKEY_RETURN || key_event.windowsKeyCode == base::VKEY_SPACE)) { - OnEnterOrSpace(); + OnUserGesture(); } // Double check the type to make sure caller hasn't sent us nonsense that diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 8e12099..8936e48 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -275,10 +275,12 @@ class RenderWidgetHost : public IPC::Channel::Listener { // overridden by RenderView to send upwards to its delegate. virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event) {} - // Notification that the user pressed the enter key or the spacebar. The - // render view host overrides this to forward the information to its delegate - // (see corresponding function in RenderViewHostDelegate). - virtual void OnEnterOrSpace() {} + // Notification that the user has made some kind of input that could + // perform an action. The render view host overrides this to forward the + // information to its delegate (see corresponding function in + // RenderViewHostDelegate). The gestures that count are 1) any mouse down + // event and 2) enter or space key presses. + virtual void OnUserGesture() {} // Callbacks for notification when the renderer becomes unresponsive to user // input events, and subsequently responsive again. RenderViewHost overrides |