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

Side by Side Diff: ui/events/win/events_win.cc

Issue 137273008: Merge 245651 "Add support for horizontal mouse wheel messages in..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1750/src/
Patch Set: Created 6 years, 11 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 | « no previous file | 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 // 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 case WM_NCRBUTTONUP: 173 case WM_NCRBUTTONUP:
174 case WM_NCXBUTTONUP: 174 case WM_NCXBUTTONUP:
175 case WM_RBUTTONUP: 175 case WM_RBUTTONUP:
176 case WM_XBUTTONUP: 176 case WM_XBUTTONUP:
177 return ET_MOUSE_RELEASED; 177 return ET_MOUSE_RELEASED;
178 case WM_MOUSEMOVE: 178 case WM_MOUSEMOVE:
179 return IsButtonDown(native_event) ? ET_MOUSE_DRAGGED : ET_MOUSE_MOVED; 179 return IsButtonDown(native_event) ? ET_MOUSE_DRAGGED : ET_MOUSE_MOVED;
180 case WM_NCMOUSEMOVE: 180 case WM_NCMOUSEMOVE:
181 return ET_MOUSE_MOVED; 181 return ET_MOUSE_MOVED;
182 case WM_MOUSEWHEEL: 182 case WM_MOUSEWHEEL:
183 case WM_MOUSEHWHEEL:
183 return ET_MOUSEWHEEL; 184 return ET_MOUSEWHEEL;
184 case WM_MOUSELEAVE: 185 case WM_MOUSELEAVE:
185 case WM_NCMOUSELEAVE: 186 case WM_NCMOUSELEAVE:
186 return ET_MOUSE_EXITED; 187 return ET_MOUSE_EXITED;
187 case WM_VSCROLL: 188 case WM_VSCROLL:
188 case WM_HSCROLL: 189 case WM_HSCROLL:
189 return ET_SCROLL; 190 return ET_SCROLL;
190 default: 191 default:
191 // We can't NOTREACHED() here, since this function can be called for any 192 // We can't NOTREACHED() here, since this function can be called for any
192 // message. 193 // message.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 case MK_RBUTTON: 262 case MK_RBUTTON:
262 return EF_RIGHT_MOUSE_BUTTON; 263 return EF_RIGHT_MOUSE_BUTTON;
263 // TODO: add support for MK_XBUTTON1. 264 // TODO: add support for MK_XBUTTON1.
264 default: 265 default:
265 break; 266 break;
266 } 267 }
267 return 0; 268 return 0;
268 } 269 }
269 270
270 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { 271 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) {
271 DCHECK(native_event.message == WM_MOUSEWHEEL); 272 DCHECK(native_event.message == WM_MOUSEWHEEL ||
272 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam)); 273 native_event.message == WM_MOUSEHWHEEL);
274 if (native_event.message == WM_MOUSEWHEEL)
275 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam));
276 return gfx::Vector2d(GET_WHEEL_DELTA_WPARAM(native_event.wParam), 0);
273 } 277 }
274 278
275 void ClearTouchIdIfReleased(const base::NativeEvent& xev) { 279 void ClearTouchIdIfReleased(const base::NativeEvent& xev) {
276 NOTIMPLEMENTED(); 280 NOTIMPLEMENTED();
277 } 281 }
278 282
279 int GetTouchId(const base::NativeEvent& xev) { 283 int GetTouchId(const base::NativeEvent& xev) {
280 NOTIMPLEMENTED(); 284 NOTIMPLEMENTED();
281 return 0; 285 return 0;
282 } 286 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 411 }
408 412
409 LPARAM GetLParamFromScanCode(uint16 scan_code) { 413 LPARAM GetLParamFromScanCode(uint16 scan_code) {
410 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; 414 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16;
411 if ((scan_code & 0xE000) == 0xE000) 415 if ((scan_code & 0xE000) == 0xE000)
412 l_param |= (1 << 24); 416 l_param |= (1 << 24);
413 return l_param; 417 return l_param;
414 } 418 }
415 419
416 } // namespace ui 420 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698