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

Side by Side Diff: content/renderer/input/input_handler_proxy.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, 9 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 unified diff | Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/input/input_handler_proxy.h" 5 #include "content/renderer/input/input_handler_proxy.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "content/renderer/input/input_handler_proxy_client.h" 10 #include "content/renderer/input/input_handler_proxy_client.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 DCHECK(input_handler_); 108 DCHECK(input_handler_);
109 109
110 if (event.type == WebInputEvent::MouseWheel) { 110 if (event.type == WebInputEvent::MouseWheel) {
111 const WebMouseWheelEvent& wheel_event = 111 const WebMouseWheelEvent& wheel_event =
112 *static_cast<const WebMouseWheelEvent*>(&event); 112 *static_cast<const WebMouseWheelEvent*>(&event);
113 if (wheel_event.scrollByPage) { 113 if (wheel_event.scrollByPage) {
114 // TODO(jamesr): We don't properly handle scroll by page in the compositor 114 // TODO(jamesr): We don't properly handle scroll by page in the compositor
115 // thread, so punt it to the main thread. http://crbug.com/236639 115 // thread, so punt it to the main thread. http://crbug.com/236639
116 return DID_NOT_HANDLE; 116 return DID_NOT_HANDLE;
117 } 117 }
118 #if !defined(OS_MACOSX)
119 if (wheel_event.modifiers & WebInputEvent::ControlKey) {
120 // Ctrl + mousewheel changes zoom on every platform except for Mac,
121 // see WebContentsImpl::HandleWheelEvent.
122 return DID_NOT_HANDLE;
123 }
124 #endif
118 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( 125 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin(
119 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); 126 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel);
120 switch (scroll_status) { 127 switch (scroll_status) {
121 case cc::InputHandler::ScrollStarted: { 128 case cc::InputHandler::ScrollStarted: {
122 TRACE_EVENT_INSTANT2( 129 TRACE_EVENT_INSTANT2(
123 "renderer", 130 "renderer",
124 "InputHandlerProxy::handle_input wheel scroll", 131 "InputHandlerProxy::handle_input wheel scroll",
125 TRACE_EVENT_SCOPE_THREAD, 132 TRACE_EVENT_SCOPE_THREAD,
126 "deltaX", 133 "deltaX",
127 -wheel_event.deltaX, 134 -wheel_event.deltaX,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 TRACE_EVENT2("renderer", 488 TRACE_EVENT2("renderer",
482 "InputHandlerProxy::notifyCurrentFlingVelocity", 489 "InputHandlerProxy::notifyCurrentFlingVelocity",
483 "vx", 490 "vx",
484 velocity.width, 491 velocity.width,
485 "vy", 492 "vy",
486 velocity.height); 493 velocity.height);
487 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); 494 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity));
488 } 495 }
489 496
490 } // namespace content 497 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698