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

Side by Side Diff: Source/web/WebInputEventConversion.cpp

Issue 22859012: Add support for DOM Level 3 WheelEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename prefixedType() to legacyType() Created 7 years, 4 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 | « Source/core/svg/SVGElementInstance.idl ('k') | 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 globalY = event.globalPosition().y(); 571 globalY = event.globalPosition().y();
572 movementX = event.movementDelta().x() * scale; 572 movementX = event.movementDelta().x() * scale;
573 movementY = event.movementDelta().y() * scale; 573 movementY = event.movementDelta().y() * scale;
574 574
575 button = static_cast<Button>(event.button()); 575 button = static_cast<Button>(event.button());
576 clickCount = event.clickCount(); 576 clickCount = event.clickCount();
577 } 577 }
578 578
579 WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const WheelEvent& event) 579 WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const WheelEvent& event)
580 { 580 {
581 if (event.type() != eventNames().mousewheelEvent) 581 if (event.type() != eventNames().wheelEvent && event.type() != eventNames(). mousewheelEvent)
582 return; 582 return;
583 type = WebInputEvent::MouseWheel; 583 type = WebInputEvent::MouseWheel;
584 updateWebMouseEventFromWebCoreMouseEvent(event, *widget, *renderObject, *thi s); 584 updateWebMouseEventFromWebCoreMouseEvent(event, *widget, *renderObject, *thi s);
585 deltaX = static_cast<float>(event.rawDeltaX()); 585 deltaX = static_cast<float>(event.rawDeltaX());
586 deltaY = static_cast<float>(event.rawDeltaY()); 586 deltaY = static_cast<float>(event.rawDeltaY());
587 // The 120 is from WheelEvent::initWheelEvent(). 587 wheelTicksX = static_cast<float>(event.wheelDeltaX()) / WheelEvent::TickMult iplier;
588 wheelTicksX = static_cast<float>(event.wheelDeltaX()) / 120; 588 wheelTicksY = static_cast<float>(event.wheelDeltaY()) / WheelEvent::TickMult iplier;
589 wheelTicksY = static_cast<float>(event.wheelDeltaY()) / 120;
590 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE; 589 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE;
591 } 590 }
592 591
593 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) 592 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
594 { 593 {
595 if (event.type() == eventNames().keydownEvent) 594 if (event.type() == eventNames().keydownEvent)
596 type = KeyDown; 595 type = KeyDown;
597 else if (event.type() == eventNames().keyupEvent) 596 else if (event.type() == eventNames().keyupEvent)
598 type = WebInputEvent::KeyUp; 597 type = WebInputEvent::KeyUp;
599 else if (event.type() == eventNames().keypressEvent) 598 else if (event.type() == eventNames().keypressEvent)
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 modifiers = getWebInputModifiers(event); 738 modifiers = getWebInputModifiers(event);
740 739
741 globalX = event.screenX(); 740 globalX = event.screenX();
742 globalY = event.screenY(); 741 globalY = event.screenY();
743 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); 742 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject);
744 x = localPoint.x(); 743 x = localPoint.x();
745 y = localPoint.y(); 744 y = localPoint.y();
746 } 745 }
747 746
748 } // namespace WebKit 747 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElementInstance.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698