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

Side by Side Diff: chrome/browser/android/vr_shell/android_ui_gesture_target.cc

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Rebased, fixed a comment in web_input_event_builders_mac.mm 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell_gl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chrome/browser/android/vr_shell/android_ui_gesture_target.h" 5 #include "chrome/browser/android/vr_shell/android_ui_gesture_target.h"
6 6
7 #include "jni/MotionEventSynthesizer_jni.h" 7 #include "jni/MotionEventSynthesizer_jni.h"
8 8
9 namespace vr_shell { 9 namespace vr_shell {
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 Inject(env, Action::Start, gesture->timeStampSeconds()); 53 Inject(env, Action::Start, gesture->timeStampSeconds());
54 Inject(env, Action::End, gesture->timeStampSeconds()); 54 Inject(env, Action::End, gesture->timeStampSeconds());
55 break; 55 break;
56 case blink::WebGestureEvent::GestureFlingCancel: 56 case blink::WebGestureEvent::GestureFlingCancel:
57 Inject(env, Action::Cancel, gesture->timeStampSeconds()); 57 Inject(env, Action::Cancel, gesture->timeStampSeconds());
58 break; 58 break;
59 case blink::WebGestureEvent::GestureFlingStart: 59 case blink::WebGestureEvent::GestureFlingStart:
60 // Flings are automatically generated for android UI. Ignore this input. 60 // Flings are automatically generated for android UI. Ignore this input.
61 break; 61 break;
62 case blink::WebMouseEvent::MouseEnter: 62 case blink::WebMouseEvent::MouseEnter:
63 SetPointer(env, mouse->x, mouse->y); 63 SetPointer(env, mouse->positionInWidget().x, mouse->positionInWidget().y);
64 Inject(env, Action::HoverEnter, gesture->timeStampSeconds()); 64 Inject(env, Action::HoverEnter, gesture->timeStampSeconds());
65 break; 65 break;
66 case blink::WebMouseEvent::MouseMove: 66 case blink::WebMouseEvent::MouseMove:
67 SetPointer(env, mouse->x, mouse->y); 67 SetPointer(env, mouse->positionInWidget().x, mouse->positionInWidget().y);
68 Inject(env, Action::HoverMove, gesture->timeStampSeconds()); 68 Inject(env, Action::HoverMove, gesture->timeStampSeconds());
69 break; 69 break;
70 case blink::WebMouseEvent::MouseLeave: 70 case blink::WebMouseEvent::MouseLeave:
71 SetPointer(env, mouse->x, mouse->y); 71 SetPointer(env, mouse->positionInWidget().x, mouse->positionInWidget().y);
72 Inject(env, Action::HoverExit, gesture->timeStampSeconds()); 72 Inject(env, Action::HoverExit, gesture->timeStampSeconds());
73 break; 73 break;
74 default: 74 default:
75 NOTREACHED(); 75 NOTREACHED();
76 break; 76 break;
77 } 77 }
78 } 78 }
79 79
80 void AndroidUiGestureTarget::SetPointer(JNIEnv* env, int x, int y) { 80 void AndroidUiGestureTarget::SetPointer(JNIEnv* env, int x, int y) {
81 content::Java_MotionEventSynthesizer_setPointer(env, event_synthesizer_, 0, x, 81 content::Java_MotionEventSynthesizer_setPointer(env, event_synthesizer_, 0, x,
(...skipping 11 matching lines...) Expand all
93 93
94 void AndroidUiGestureTarget::Inject(JNIEnv* env, 94 void AndroidUiGestureTarget::Inject(JNIEnv* env,
95 Action action, 95 Action action,
96 double time_in_seconds) { 96 double time_in_seconds) {
97 content::Java_MotionEventSynthesizer_inject( 97 content::Java_MotionEventSynthesizer_inject(
98 env, event_synthesizer_, static_cast<int>(action), 1, 98 env, event_synthesizer_, static_cast<int>(action), 1,
99 static_cast<int64_t>(time_in_seconds * 1000.0)); 99 static_cast<int64_t>(time_in_seconds * 1000.0));
100 } 100 }
101 101
102 } // namespace vr_shell 102 } // namespace vr_shell
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell_gl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698