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

Side by Side Diff: content/browser/web_contents/web_contents_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, 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { 1152 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
1153 if (browser_plugin_embedder_ && 1153 if (browser_plugin_embedder_ &&
1154 browser_plugin_embedder_->HandleKeyboardEvent(event)) { 1154 browser_plugin_embedder_->HandleKeyboardEvent(event)) {
1155 return; 1155 return;
1156 } 1156 }
1157 1157
1158 if (delegate_) 1158 if (delegate_)
1159 delegate_->HandleKeyboardEvent(this, event); 1159 delegate_->HandleKeyboardEvent(this, event);
1160 } 1160 }
1161 1161
1162 bool WebContentsImpl::PreHandleWheelEvent( 1162 bool WebContentsImpl::HandleWheelEvent(const blink::WebMouseWheelEvent& event) {
1163 const blink::WebMouseWheelEvent& event) {
1164 #if !defined(OS_MACOSX) 1163 #if !defined(OS_MACOSX)
1165 // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this 1164 // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this
1166 // isn't done for two reasons: 1165 // isn't done for two reasons:
1167 // -the OS already has a gesture to do this through pinch-zoom 1166 // -the OS already has a gesture to do this through pinch-zoom
1168 // -if a user starts an inertial scroll, let's go, and presses control 1167 // -if a user starts an inertial scroll, let's go, and presses control
1169 // (i.e. control+tab) then the OS's buffered scroll events will come in 1168 // (i.e. control+tab) then the OS's buffered scroll events will come in
1170 // with control key set which isn't what the user wants 1169 // with control key set which isn't what the user wants
1171 if (delegate_ && 1170 if (delegate_ &&
1172 event.wheelTicksY && 1171 event.wheelTicksY &&
1173 (event.modifiers & blink::WebInputEvent::ControlKey)) { 1172 (event.modifiers & blink::WebInputEvent::ControlKey)) {
(...skipping 2488 matching lines...) Expand 10 before | Expand all | Expand 10 after
3662 3661
3663 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 3662 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
3664 if (!delegate_) 3663 if (!delegate_)
3665 return; 3664 return;
3666 const gfx::Size new_size = GetPreferredSize(); 3665 const gfx::Size new_size = GetPreferredSize();
3667 if (new_size != old_size) 3666 if (new_size != old_size)
3668 delegate_->UpdatePreferredSize(this, new_size); 3667 delegate_->UpdatePreferredSize(this, new_size);
3669 } 3668 }
3670 3669
3671 } // namespace content 3670 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/renderer/input/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698