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/base/events.h" | 7 #include "ui/base/events.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { | 218 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { |
219 return KeyboardCodeForWindowsKeyCode(native_event.wParam); | 219 return KeyboardCodeForWindowsKeyCode(native_event.wParam); |
220 } | 220 } |
221 | 221 |
222 bool IsMouseEvent(const base::NativeEvent& native_event) { | 222 bool IsMouseEvent(const base::NativeEvent& native_event) { |
223 return IsClientMouseEvent(native_event) || | 223 return IsClientMouseEvent(native_event) || |
224 IsNonClientMouseEvent(native_event); | 224 IsNonClientMouseEvent(native_event); |
225 } | 225 } |
226 | 226 |
| 227 int GetChangedMouseButtonFlagsFromNative( |
| 228 const base::NativeEvent& native_event) { |
| 229 // TODO(sky): implement me. |
| 230 return 0; |
| 231 } |
| 232 |
227 int GetMouseWheelOffset(const base::NativeEvent& native_event) { | 233 int GetMouseWheelOffset(const base::NativeEvent& native_event) { |
228 DCHECK(native_event.message == WM_MOUSEWHEEL); | 234 DCHECK(native_event.message == WM_MOUSEWHEEL); |
229 return GET_WHEEL_DELTA_WPARAM(native_event.wParam); | 235 return GET_WHEEL_DELTA_WPARAM(native_event.wParam); |
230 } | 236 } |
231 | 237 |
232 int GetTouchId(const base::NativeEvent& xev) { | 238 int GetTouchId(const base::NativeEvent& xev) { |
233 NOTIMPLEMENTED(); | 239 NOTIMPLEMENTED(); |
234 return 0; | 240 return 0; |
235 } | 241 } |
236 | 242 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // Windows emulates mouse messages for touch events. | 324 // Windows emulates mouse messages for touch events. |
319 bool IsMouseEventFromTouch(UINT message) { | 325 bool IsMouseEventFromTouch(UINT message) { |
320 return (message == WM_MOUSEMOVE || | 326 return (message == WM_MOUSEMOVE || |
321 message == WM_LBUTTONDOWN || message == WM_LBUTTONUP || | 327 message == WM_LBUTTONDOWN || message == WM_LBUTTONUP || |
322 message == WM_RBUTTONDOWN || message == WM_RBUTTONUP) && | 328 message == WM_RBUTTONDOWN || message == WM_RBUTTONUP) && |
323 (GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == | 329 (GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == |
324 MOUSEEVENTF_FROMTOUCH; | 330 MOUSEEVENTF_FROMTOUCH; |
325 } | 331 } |
326 | 332 |
327 } // namespace ui | 333 } // namespace ui |
OLD | NEW |