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

Side by Side Diff: ui/events/blink/web_input_event_builders_win.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse constructor Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/events/blink/web_input_event_builders_win.h" 5 #include "ui/events/blink/web_input_event_builders_win.h"
6 6
7 #include "ui/display/win/screen_win.h" 7 #include "ui/display/win/screen_win.h"
8 #include "ui/events/blink/blink_event_util.h" 8 #include "ui/events/blink/blink_event_util.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (wparam & MK_LBUTTON) 160 if (wparam & MK_LBUTTON)
161 modifiers |= WebInputEvent::LeftButtonDown; 161 modifiers |= WebInputEvent::LeftButtonDown;
162 if (wparam & MK_MBUTTON) 162 if (wparam & MK_MBUTTON)
163 modifiers |= WebInputEvent::MiddleButtonDown; 163 modifiers |= WebInputEvent::MiddleButtonDown;
164 if (wparam & MK_RBUTTON) 164 if (wparam & MK_RBUTTON)
165 modifiers |= WebInputEvent::RightButtonDown; 165 modifiers |= WebInputEvent::RightButtonDown;
166 166
167 WebMouseEvent result(type, modifiers, time_stamp); 167 WebMouseEvent result(type, modifiers, time_stamp);
168 result.pointerType = pointer_type; 168 result.pointerType = pointer_type;
169 result.button = button; 169 result.button = button;
170 result.id = ui::PointerEvent::kMousePointerId; 170 result.id = ui::MouseEvent::kMousePointerId;
171 171
172 // set position fields: 172 // set position fields:
173 result.x = static_cast<short>(LOWORD(lparam)); 173 result.x = static_cast<short>(LOWORD(lparam));
174 result.y = static_cast<short>(HIWORD(lparam)); 174 result.y = static_cast<short>(HIWORD(lparam));
175 175
176 POINT global_point = {result.x, result.y}; 176 POINT global_point = {result.x, result.y};
177 ClientToScreen(hwnd, &global_point); 177 ClientToScreen(hwnd, &global_point);
178 178
179 // We need to convert the global point back to DIP before using it. 179 // We need to convert the global point back to DIP before using it.
180 gfx::Point dip_global_point = display::win::ScreenWin::ScreenToDIPPoint( 180 gfx::Point dip_global_point = display::win::ScreenWin::ScreenToDIPPoint(
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 result.wheelTicksX = wheel_delta; 361 result.wheelTicksX = wheel_delta;
362 } else { 362 } else {
363 result.deltaY = scroll_delta; 363 result.deltaY = scroll_delta;
364 result.wheelTicksY = wheel_delta; 364 result.wheelTicksY = wheel_delta;
365 } 365 }
366 366
367 return result; 367 return result;
368 } 368 }
369 369
370 } // namespace ui 370 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698