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

Side by Side Diff: content/browser/renderer_host/web_input_event_aura.cc

Issue 2097743002: Cleanup: decouple web_input_event_aura and ui_events_helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160502-MacViews-Elastic-FILE-MOVES
Patch Set: Whoops - that comment should be kept Created 4 years, 5 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
« no previous file with comments | « content/browser/renderer_host/ui_events_helper.cc ('k') | 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 "content/browser/renderer_host/web_input_event_aura.h" 5 #include "content/browser/renderer_host/web_input_event_aura.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/browser/renderer_host/input/web_input_event_util.h" 8 #include "content/browser/renderer_host/input/web_input_event_util.h"
9 #include "content/browser/renderer_host/ui_events_helper.h"
10 #include "ui/aura/client/screen_position_client.h" 9 #include "ui/aura/client/screen_position_client.h"
11 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
12 #include "ui/events/base_event_utils.h" 11 #include "ui/events/base_event_utils.h"
13 #include "ui/events/blink/blink_event_util.h" 12 #include "ui/events/blink/blink_event_util.h"
14 #include "ui/events/event.h" 13 #include "ui/events/event.h"
15 #include "ui/events/event_utils.h" 14 #include "ui/events/event_utils.h"
16 #include "ui/events/keycodes/dom/keycode_converter.h" 15 #include "ui/events/keycodes/dom/keycode_converter.h"
17 #include "ui/events/keycodes/keyboard_code_conversion.h" 16 #include "ui/events/keycodes/keyboard_code_conversion.h"
18 17
19 namespace content { 18 namespace content {
(...skipping 25 matching lines...) Expand all
45 return blink::WebPointerProperties::PointerType::Mouse; 44 return blink::WebPointerProperties::PointerType::Mouse;
46 case ui::EventPointerType::POINTER_TYPE_PEN: 45 case ui::EventPointerType::POINTER_TYPE_PEN:
47 return blink::WebPointerProperties::PointerType::Pen; 46 return blink::WebPointerProperties::PointerType::Pen;
48 case ui::EventPointerType::POINTER_TYPE_TOUCH: 47 case ui::EventPointerType::POINTER_TYPE_TOUCH:
49 return blink::WebPointerProperties::PointerType::Touch; 48 return blink::WebPointerProperties::PointerType::Touch;
50 } 49 }
51 NOTREACHED() << "Unexpected EventPointerType"; 50 NOTREACHED() << "Unexpected EventPointerType";
52 return blink::WebPointerProperties::PointerType::Unknown; 51 return blink::WebPointerProperties::PointerType::Unknown;
53 } 52 }
54 53
54 // Creates a WebGestureEvent from a ui::GestureEvent. Note that it does not
55 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So
56 // the caller must populate these fields.
tapted 2016/06/27 00:18:38 (just noticed I'd misplaced this comment, but of c
57 blink::WebGestureEvent MakeWebGestureEventFromUIEvent(
58 const ui::GestureEvent& event) {
59 return ui::CreateWebGestureEvent(
60 event.details(), event.time_stamp(), event.location_f(),
61 event.root_location_f(), event.flags(), event.unique_touch_event_id());
62 }
63
55 } // namespace 64 } // namespace
56 65
57 #if defined(OS_WIN) 66 #if defined(OS_WIN)
58 blink::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent( 67 blink::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent(
59 const base::NativeEvent& native_event, 68 const base::NativeEvent& native_event,
60 const base::TimeTicks& time_stamp, 69 const base::TimeTicks& time_stamp,
61 blink::WebPointerProperties::PointerType pointer_type); 70 blink::WebPointerProperties::PointerType pointer_type);
62 blink::WebMouseWheelEvent MakeUntranslatedWebMouseWheelEventFromNativeEvent( 71 blink::WebMouseWheelEvent MakeUntranslatedWebMouseWheelEventFromNativeEvent(
63 const base::NativeEvent& native_event, 72 const base::NativeEvent& native_event,
64 const base::TimeTicks& time_stamp, 73 const base::TimeTicks& time_stamp,
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); 450 webkit_event.tiltX = roundf(event.pointer_details().tilt_x);
442 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); 451 webkit_event.tiltY = roundf(event.pointer_details().tilt_y);
443 webkit_event.force = event.pointer_details().force; 452 webkit_event.force = event.pointer_details().force;
444 webkit_event.pointerType = 453 webkit_event.pointerType =
445 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); 454 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type);
446 455
447 return webkit_event; 456 return webkit_event;
448 } 457 }
449 458
450 } // namespace content 459 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/ui_events_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698