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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 14233003: Merge 194942 "Disable page zoom through control+scroll on Mac." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1453/src/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 delegate_->PreHandleKeyboardEvent(this, event, is_keyboard_shortcut); 1256 delegate_->PreHandleKeyboardEvent(this, event, is_keyboard_shortcut);
1257 } 1257 }
1258 1258
1259 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { 1259 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
1260 if (delegate_) 1260 if (delegate_)
1261 delegate_->HandleKeyboardEvent(this, event); 1261 delegate_->HandleKeyboardEvent(this, event);
1262 } 1262 }
1263 1263
1264 bool WebContentsImpl::PreHandleWheelEvent( 1264 bool WebContentsImpl::PreHandleWheelEvent(
1265 const WebKit::WebMouseWheelEvent& event) { 1265 const WebKit::WebMouseWheelEvent& event) {
1266 #if !defined(OS_MACOSX)
1267 // On platforms other than Mac, control+mousewheel changes zoom. On Mac, this
1268 // isn't done for two reasons:
1269 // -the OS already has a gesture to do this through pinch-zoom
1270 // -if a user starts an inertial scroll, let's go, and presses control
1271 // (i.e. control+tab) then the OS's buffered scroll events will come in
1272 // with control key set which isn't what the user wants
1266 if (delegate_ && 1273 if (delegate_ &&
1267 event.wheelTicksY && 1274 event.wheelTicksY &&
1268 (event.modifiers & WebKit::WebInputEvent::ControlKey)) { 1275 (event.modifiers & WebKit::WebInputEvent::ControlKey)) {
1269 delegate_->ContentsZoomChange(event.wheelTicksY > 0); 1276 delegate_->ContentsZoomChange(event.wheelTicksY > 0);
1270 return true; 1277 return true;
1271 } 1278 }
1279 #endif
1272 1280
1273 return false; 1281 return false;
1274 } 1282 }
1275 1283
1276 void WebContentsImpl::HandleMouseDown() { 1284 void WebContentsImpl::HandleMouseDown() {
1277 if (delegate_) 1285 if (delegate_)
1278 delegate_->HandleMouseDown(); 1286 delegate_->HandleMouseDown();
1279 } 1287 }
1280 1288
1281 void WebContentsImpl::HandleMouseUp() { 1289 void WebContentsImpl::HandleMouseUp() {
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after
3463 } 3471 }
3464 3472
3465 BrowserPluginGuestManager* 3473 BrowserPluginGuestManager*
3466 WebContentsImpl::GetBrowserPluginGuestManager() const { 3474 WebContentsImpl::GetBrowserPluginGuestManager() const {
3467 return static_cast<BrowserPluginGuestManager*>( 3475 return static_cast<BrowserPluginGuestManager*>(
3468 GetBrowserContext()->GetUserData( 3476 GetBrowserContext()->GetUserData(
3469 browser_plugin::kBrowserPluginGuestManagerKeyName)); 3477 browser_plugin::kBrowserPluginGuestManagerKeyName));
3470 } 3478 }
3471 3479
3472 } // namespace content 3480 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698