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

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

Issue 759073002: Add canScroll bit to WebMouseWheelEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modify unit test Created 6 years 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) 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (e.modifiers & WebInputEvent::ShiftKey) 147 if (e.modifiers & WebInputEvent::ShiftKey)
148 m_modifiers |= PlatformEvent::ShiftKey; 148 m_modifiers |= PlatformEvent::ShiftKey;
149 if (e.modifiers & WebInputEvent::ControlKey) 149 if (e.modifiers & WebInputEvent::ControlKey)
150 m_modifiers |= PlatformEvent::CtrlKey; 150 m_modifiers |= PlatformEvent::CtrlKey;
151 if (e.modifiers & WebInputEvent::AltKey) 151 if (e.modifiers & WebInputEvent::AltKey)
152 m_modifiers |= PlatformEvent::AltKey; 152 m_modifiers |= PlatformEvent::AltKey;
153 if (e.modifiers & WebInputEvent::MetaKey) 153 if (e.modifiers & WebInputEvent::MetaKey)
154 m_modifiers |= PlatformEvent::MetaKey; 154 m_modifiers |= PlatformEvent::MetaKey;
155 155
156 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas; 156 m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas;
157 m_canScroll = e.canScroll;
157 #if OS(MACOSX) 158 #if OS(MACOSX)
158 m_phase = static_cast<PlatformWheelEventPhase>(e.phase); 159 m_phase = static_cast<PlatformWheelEventPhase>(e.phase);
159 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase); 160 m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase);
160 m_timestamp = e.timeStampSeconds; 161 m_timestamp = e.timeStampSeconds;
161 m_canRubberbandLeft = e.canRubberbandLeft; 162 m_canRubberbandLeft = e.canRubberbandLeft;
162 m_canRubberbandRight = e.canRubberbandRight; 163 m_canRubberbandRight = e.canRubberbandRight;
163 #endif 164 #endif
164 } 165 }
165 166
166 // PlatformGestureEventBuilder ------------------------------------------------- - 167 // PlatformGestureEventBuilder ------------------------------------------------- -
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 { 635 {
635 if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames: :mousewheel) 636 if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames: :mousewheel)
636 return; 637 return;
637 type = WebInputEvent::MouseWheel; 638 type = WebInputEvent::MouseWheel;
638 updateWebMouseEventFromCoreMouseEvent(event, widget, *renderObject, *this); 639 updateWebMouseEventFromCoreMouseEvent(event, widget, *renderObject, *this);
639 deltaX = -event.deltaX(); 640 deltaX = -event.deltaX();
640 deltaY = -event.deltaY(); 641 deltaY = -event.deltaY();
641 wheelTicksX = event.ticksX(); 642 wheelTicksX = event.ticksX();
642 wheelTicksY = event.ticksY(); 643 wheelTicksY = event.ticksY();
643 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE; 644 scrollByPage = event.deltaMode() == WheelEvent::DOM_DELTA_PAGE;
645 canScroll = event.canScroll();
644 } 646 }
645 647
646 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) 648 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
647 { 649 {
648 if (event.type() == EventTypeNames::keydown) 650 if (event.type() == EventTypeNames::keydown)
649 type = KeyDown; 651 type = KeyDown;
650 else if (event.type() == EventTypeNames::keyup) 652 else if (event.type() == EventTypeNames::keyup)
651 type = WebInputEvent::KeyUp; 653 type = WebInputEvent::KeyUp;
652 else if (event.type() == EventTypeNames::keypress) 654 else if (event.type() == EventTypeNames::keypress)
653 type = WebInputEvent::Char; 655 type = WebInputEvent::Char;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 modifiers = getWebInputModifiers(event); 816 modifiers = getWebInputModifiers(event);
815 817
816 globalX = event.screenX(); 818 globalX = event.screenX();
817 globalY = event.screenY(); 819 globalY = event.screenY();
818 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); 820 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject);
819 x = localPoint.x(); 821 x = localPoint.x();
820 y = localPoint.y(); 822 y = localPoint.y();
821 } 823 }
822 824
823 } // namespace blink 825 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698