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

Side by Side Diff: Source/core/frame/PinchViewport.cpp

Issue 1018183002: Add rails to input wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More plumbing and tests Created 5 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/core/events/WheelEvent.cpp ('k') | Source/platform/PlatformEvent.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 { 443 {
444 FrameView* view = mainFrame()->view(); 444 FrameView* view = mainFrame()->view();
445 ScrollResult viewScrollResult = view->wheelEvent(event); 445 ScrollResult viewScrollResult = view->wheelEvent(event);
446 446
447 // The virtual viewport will only accept pixel scrolls. 447 // The virtual viewport will only accept pixel scrolls.
448 if (!event.canScroll() || event.granularity() == ScrollByPageWheelEvent) 448 if (!event.canScroll() || event.granularity() == ScrollByPageWheelEvent)
449 return viewScrollResult; 449 return viewScrollResult;
450 450
451 // Move the location by the negative of the remaining scroll delta. 451 // Move the location by the negative of the remaining scroll delta.
452 FloatPoint oldOffset = m_offset; 452 FloatPoint oldOffset = m_offset;
453 FloatPoint locationDelta = viewScrollResult.didScroll ? 453 FloatPoint locationDelta;
454 -FloatPoint(viewScrollResult.unusedScrollDeltaX, viewScrollResult.unused ScrollDeltaY) : 454 if (viewScrollResult.didScroll) {
455 -FloatPoint(event.deltaX(), event.deltaY()); 455 locationDelta = -FloatPoint(viewScrollResult.unusedScrollDeltaX, viewScr ollResult.unusedScrollDeltaY);
456 } else {
457 if (event.railsMode() != PlatformEvent::RailsModeVertical)
458 locationDelta.setX(-event.deltaX());
459 if (event.railsMode() != PlatformEvent::RailsModeHorizontal)
460 locationDelta.setY(-event.deltaY());
461 }
456 move(locationDelta); 462 move(locationDelta);
457 463
458 FloatPoint usedLocationDelta(m_offset - oldOffset); 464 FloatPoint usedLocationDelta(m_offset - oldOffset);
459 if (!viewScrollResult.didScroll && usedLocationDelta == FloatPoint::zero()) 465 if (!viewScrollResult.didScroll && usedLocationDelta == FloatPoint::zero())
460 return ScrollResult(false); 466 return ScrollResult(false);
461 467
462 FloatPoint unusedLocationDelta(locationDelta - usedLocationDelta); 468 FloatPoint unusedLocationDelta(locationDelta - usedLocationDelta);
463 return ScrollResult(true, -unusedLocationDelta.x(), -unusedLocationDelta.y() ); 469 return ScrollResult(true, -unusedLocationDelta.x(), -unusedLocationDelta.y() );
464 } 470 }
465 471
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } else if (graphicsLayer == m_rootTransformLayer) { 639 } else if (graphicsLayer == m_rootTransformLayer) {
634 name = "Root Transform Layer"; 640 name = "Root Transform Layer";
635 } else { 641 } else {
636 ASSERT_NOT_REACHED(); 642 ASSERT_NOT_REACHED();
637 } 643 }
638 644
639 return name; 645 return name;
640 } 646 }
641 647
642 } // namespace blink 648 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/events/WheelEvent.cpp ('k') | Source/platform/PlatformEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698