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

Unified Diff: content/browser/renderer_host/input/input_router_impl.cc

Issue 165143003: Handle Ctrl+Mousewheel after renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable Ctrl+wheel checks on Mac Created 6 years, 10 months 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 | « no previous file | content/browser/renderer_host/render_widget_host_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/input_router_impl.cc
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index e4b4d82ee88c70386cb05acdd3b69a36e78e6a37..60acbd9fa8f67c9014226378a17c1a69513d1263 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -424,6 +424,13 @@ void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event,
bool InputRouterImpl::OfferToOverscrollController(
const WebInputEvent& input_event,
const ui::LatencyInfo& latency_info) {
+#if !defined(OS_MACOSX)
+ // Ctrl + mousewheel is reserved for zooming on every platform except for Mac.
+ if (input_event.type == WebInputEvent::MouseWheel &&
+ input_event.modifiers & WebInputEvent::ControlKey)
+ return false;
+#endif
+
OverscrollController* controller = client_->GetOverscrollController();
if (!controller)
return false;
@@ -630,7 +637,14 @@ void InputRouterImpl::ProcessMouseAck(blink::WebInputEvent::Type type,
void InputRouterImpl::ProcessWheelAck(InputEventAckState ack_result,
const ui::LatencyInfo& latency) {
+#if defined(OS_MACOSX)
ProcessAckForOverscroll(current_wheel_event_.event, ack_result);
+#else
+ // Ctrl + mousewheel is reserved for zooming on every platform except for Mac.
+ if (!(current_wheel_event_.event.modifiers & WebInputEvent::ControlKey)) {
+ ProcessAckForOverscroll(current_wheel_event_.event, ack_result);
+ }
+#endif
// TODO(miletus): Add renderer side latency to each uncoalesced mouse
// wheel event and add terminal component to each of them.
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698