| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <windowsx.h> | 5 #include <windowsx.h> |
| 6 | 6 |
| 7 #include "ui/events/event_constants.h" | 7 #include "ui/events/event_constants.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 return EF_MIDDLE_MOUSE_BUTTON; | 276 return EF_MIDDLE_MOUSE_BUTTON; |
| 277 case MK_RBUTTON: | 277 case MK_RBUTTON: |
| 278 return EF_RIGHT_MOUSE_BUTTON; | 278 return EF_RIGHT_MOUSE_BUTTON; |
| 279 // TODO: add support for MK_XBUTTON1. | 279 // TODO: add support for MK_XBUTTON1. |
| 280 default: | 280 default: |
| 281 break; | 281 break; |
| 282 } | 282 } |
| 283 return 0; | 283 return 0; |
| 284 } | 284 } |
| 285 | 285 |
| 286 PointerDetails GetMousePointerDetailsFromNative( |
| 287 const base::NativeEvent& native_event) { |
| 288 return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE); |
| 289 } |
| 290 |
| 286 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { | 291 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { |
| 287 DCHECK(native_event.message == WM_MOUSEWHEEL || | 292 DCHECK(native_event.message == WM_MOUSEWHEEL || |
| 288 native_event.message == WM_MOUSEHWHEEL); | 293 native_event.message == WM_MOUSEHWHEEL); |
| 289 if (native_event.message == WM_MOUSEWHEEL) | 294 if (native_event.message == WM_MOUSEWHEEL) |
| 290 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam)); | 295 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam)); |
| 291 return gfx::Vector2d(GET_WHEEL_DELTA_WPARAM(native_event.wParam), 0); | 296 return gfx::Vector2d(GET_WHEEL_DELTA_WPARAM(native_event.wParam), 0); |
| 292 } | 297 } |
| 293 | 298 |
| 294 base::NativeEvent CopyNativeEvent(const base::NativeEvent& event) { | 299 base::NativeEvent CopyNativeEvent(const base::NativeEvent& event) { |
| 295 return event; | 300 return event; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 413 } |
| 409 | 414 |
| 410 LPARAM GetLParamFromScanCode(uint16 scan_code) { | 415 LPARAM GetLParamFromScanCode(uint16 scan_code) { |
| 411 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; | 416 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; |
| 412 if ((scan_code & 0xE000) == 0xE000) | 417 if ((scan_code & 0xE000) == 0xE000) |
| 413 l_param |= (1 << 24); | 418 l_param |= (1 << 24); |
| 414 return l_param; | 419 return l_param; |
| 415 } | 420 } |
| 416 | 421 |
| 417 } // namespace ui | 422 } // namespace ui |
| OLD | NEW |