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

Side by Side Diff: sky/engine/platform/scroll/ScrollableArea.cpp

Issue 870073003: Remove mouse events from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 else if (behaviorString == "instant") 174 else if (behaviorString == "instant")
175 behavior = ScrollBehaviorInstant; 175 behavior = ScrollBehaviorInstant;
176 else if (behaviorString == "smooth") 176 else if (behaviorString == "smooth")
177 behavior = ScrollBehaviorSmooth; 177 behavior = ScrollBehaviorSmooth;
178 else 178 else
179 return false; 179 return false;
180 180
181 return true; 181 return true;
182 } 182 }
183 183
184 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
185 {
186 // ctrl+wheel events are used to trigger zooming, not scrolling.
187 if (wheelEvent.modifiers() & PlatformEvent::CtrlKey)
188 return false;
189
190 return scrollAnimator()->handleWheelEvent(wheelEvent);
191 }
192
193 void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset) 184 void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
194 { 185 {
195 scrollPositionChanged(offset); 186 scrollPositionChanged(offset);
196 } 187 }
197 188
198 void ScrollableArea::mouseEnteredContentArea() const 189 void ScrollableArea::mouseEnteredContentArea() const
199 { 190 {
200 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) 191 if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
201 scrollAnimator->mouseEnteredContentArea(); 192 scrollAnimator->mouseEnteredContentArea();
202 } 193 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 { 294 {
304 return scrollSize(orientation); 295 return scrollSize(orientation);
305 } 296 }
306 297
307 float ScrollableArea::pixelStep(ScrollbarOrientation) const 298 float ScrollableArea::pixelStep(ScrollbarOrientation) const
308 { 299 {
309 return 1; 300 return 1;
310 } 301 }
311 302
312 } // namespace blink 303 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698