| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 #include "KeyboardCodes.h" | 9 #include "KeyboardCodes.h" |
| 10 #include "StringImpl.h" // This is so that the KJS build works | 10 #include "StringImpl.h" // This is so that the KJS build works |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 m_clickCount = e.layout_test_click_count; | 116 m_clickCount = e.layout_test_click_count; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 // MakePlatformWheelEvent ----------------------------------------------------- | 120 // MakePlatformWheelEvent ----------------------------------------------------- |
| 121 | 121 |
| 122 MakePlatformWheelEvent::MakePlatformWheelEvent(Widget* widget, | 122 MakePlatformWheelEvent::MakePlatformWheelEvent(Widget* widget, |
| 123 const WebMouseWheelEvent& e) { | 123 const WebMouseWheelEvent& e) { |
| 124 m_position = widget->convertFromContainingWindow(IntPoint(e.x, e.y)); | 124 m_position = widget->convertFromContainingWindow(IntPoint(e.x, e.y)); |
| 125 m_globalPosition = IntPoint(e.global_x, e.global_y); | 125 m_globalPosition = IntPoint(e.global_x, e.global_y); |
| 126 m_deltaX = static_cast<float>(e.delta_x); | 126 m_deltaX = e.delta_x; |
| 127 m_deltaY = static_cast<float>(e.delta_y); | 127 m_deltaY = e.delta_y; |
| 128 m_isAccepted = false; | 128 m_isAccepted = false; |
| 129 m_granularity = ScrollByLineWheelEvent; | 129 m_granularity = e.scroll_by_page ? |
| 130 ScrollByPageWheelEvent : ScrollByLineWheelEvent; |
| 130 m_shiftKey = (e.modifiers & WebInputEvent::SHIFT_KEY) != 0; | 131 m_shiftKey = (e.modifiers & WebInputEvent::SHIFT_KEY) != 0; |
| 131 m_ctrlKey = (e.modifiers & WebInputEvent::CTRL_KEY) != 0; | 132 m_ctrlKey = (e.modifiers & WebInputEvent::CTRL_KEY) != 0; |
| 132 m_altKey = (e.modifiers & WebInputEvent::ALT_KEY) != 0; | 133 m_altKey = (e.modifiers & WebInputEvent::ALT_KEY) != 0; |
| 133 m_metaKey = (e.modifiers & WebInputEvent::META_KEY) != 0; | 134 m_metaKey = (e.modifiers & WebInputEvent::META_KEY) != 0; |
| 134 } | 135 } |
| 135 | 136 |
| 136 // MakePlatformKeyboardEvent -------------------------------------------------- | 137 // MakePlatformKeyboardEvent -------------------------------------------------- |
| 137 | 138 |
| 138 static inline const PlatformKeyboardEvent::Type ToPlatformKeyboardEventType( | 139 static inline const PlatformKeyboardEvent::Type ToPlatformKeyboardEventType( |
| 139 WebInputEvent::Type type) { | 140 WebInputEvent::Type type) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 switch (windowsVirtualKeyCode()) { | 194 switch (windowsVirtualKeyCode()) { |
| 194 case VKEY_BACK: | 195 case VKEY_BACK: |
| 195 case VKEY_ESCAPE: | 196 case VKEY_ESCAPE: |
| 196 return false; | 197 return false; |
| 197 | 198 |
| 198 default: | 199 default: |
| 199 break; | 200 break; |
| 200 } | 201 } |
| 201 return true; | 202 return true; |
| 202 } | 203 } |
| OLD | NEW |