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

Side by Side Diff: Source/web/WebInputEventFactoryMac.mm

Issue 197213011: Selectively disable rubber banding on mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove all changes to ScrollElasticityController.{h,mm} 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 | « Source/web/WebInputEventConversion.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2006-2009 Google Inc. 3 * Copyright (C) 2006-2009 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 { 960 {
961 if (![event respondsToSelector:@selector(momentumPhase)]) 961 if (![event respondsToSelector:@selector(momentumPhase)])
962 return WebMouseWheelEvent::PhaseNone; 962 return WebMouseWheelEvent::PhaseNone;
963 963
964 NSEventPhase eventMomentumPhase = [event momentumPhase]; 964 NSEventPhase eventMomentumPhase = [event momentumPhase];
965 return phaseForNSEventPhase(eventMomentumPhase); 965 return phaseForNSEventPhase(eventMomentumPhase);
966 } 966 }
967 967
968 WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(NSEvent* event, NSView* view) 968 WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(NSEvent* event, NSView* view)
969 { 969 {
970 return mouseWheelEvent(event, view, true, true);
971 }
972
973 WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(NSEvent* event, NSView* view, bool canRubberbandLeft, bool canRubberbandRight)
974 {
970 WebMouseWheelEvent result; 975 WebMouseWheelEvent result;
971 976
972 result.type = WebInputEvent::MouseWheel; 977 result.type = WebInputEvent::MouseWheel;
973 result.button = WebMouseEvent::ButtonNone; 978 result.button = WebMouseEvent::ButtonNone;
974 979
975 result.modifiers = modifiersFromEvent(event); 980 result.modifiers = modifiersFromEvent(event);
976 981
977 setWebEventLocationFromEventInView(&result, event, view); 982 setWebEventLocationFromEventInView(&result, event, view);
978 983
984 result.canRubberbandLeft = canRubberbandLeft;
985 result.canRubberbandRight = canRubberbandRight;
986
979 // Of Mice and Men 987 // Of Mice and Men
980 // --------------- 988 // ---------------
981 // 989 //
982 // There are three types of scroll data available on a scroll wheel CGEvent. 990 // There are three types of scroll data available on a scroll wheel CGEvent.
983 // Apple's documentation ([1]) is rather vague in their differences, and not 991 // Apple's documentation ([1]) is rather vague in their differences, and not
984 // terribly helpful in deciding which to use. This is what's really going on . 992 // terribly helpful in deciding which to use. This is what's really going on .
985 // 993 //
986 // First, these events behave very differently depending on whether a standa rd 994 // First, these events behave very differently depending on whether a standa rd
987 // wheel mouse is used (one that scrolls in discrete units) or a 995 // wheel mouse is used (one that scrolls in discrete units) or a
988 // trackpad/Mighty Mouse is used (which both provide continuous scrolling). 996 // trackpad/Mighty Mouse is used (which both provide continuous scrolling).
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 break; 1145 break;
1138 default: 1146 default:
1139 ASSERT_NOT_REACHED(); 1147 ASSERT_NOT_REACHED();
1140 result.type = WebInputEvent::Undefined; 1148 result.type = WebInputEvent::Undefined;
1141 } 1149 }
1142 1150
1143 return result; 1151 return result;
1144 } 1152 }
1145 1153
1146 } // namespace blink 1154 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebInputEventConversion.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698