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

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

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Truncated to int on input, git cl format 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 "chrome/browser/android/vr_shell/vr_shell_gl.h" 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h"
6 6
7 #include <chrono> 7 #include <chrono>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 return quat; 110 return quat;
111 } 111 }
112 112
113 std::unique_ptr<blink::WebMouseEvent> MakeMouseEvent(WebInputEvent::Type type, 113 std::unique_ptr<blink::WebMouseEvent> MakeMouseEvent(WebInputEvent::Type type,
114 double timestamp, 114 double timestamp,
115 float x, 115 float x,
116 float y) { 116 float y) {
117 std::unique_ptr<blink::WebMouseEvent> mouse_event(new blink::WebMouseEvent( 117 std::unique_ptr<blink::WebMouseEvent> mouse_event(new blink::WebMouseEvent(
118 type, blink::WebInputEvent::NoModifiers, timestamp)); 118 type, blink::WebInputEvent::NoModifiers, timestamp));
119 mouse_event->pointerType = blink::WebPointerProperties::PointerType::Mouse; 119 mouse_event->pointerType = blink::WebPointerProperties::PointerType::Mouse;
120 mouse_event->x = x; 120 mouse_event->setPositionInWidget(x, y);
121 mouse_event->y = y;
122 mouse_event->clickCount = 1; 121 mouse_event->clickCount = 1;
123 122
124 return mouse_event; 123 return mouse_event;
125 } 124 }
126 125
127 enum class ViewerType { 126 enum class ViewerType {
128 UNKNOWN_TYPE = 0, 127 UNKNOWN_TYPE = 0,
129 CARDBOARD = 1, 128 CARDBOARD = 1,
130 DAYDREAM = 2, 129 DAYDREAM = 2,
131 VIEWER_TYPE_MAX, 130 VIEWER_TYPE_MAX,
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 // appropriate recommended render resolution as the default size during 1303 // appropriate recommended render resolution as the default size during
1305 // InitializeGl. Revisit if the initialization order changes. 1304 // InitializeGl. Revisit if the initialization order changes.
1306 device::mojom::VRDisplayInfoPtr info = VrShell::CreateVRDisplayInfo( 1305 device::mojom::VRDisplayInfoPtr info = VrShell::CreateVRDisplayInfo(
1307 gvr_api_.get(), webvr_surface_size_, device_id); 1306 gvr_api_.get(), webvr_surface_size_, device_id);
1308 main_thread_task_runner_->PostTask( 1307 main_thread_task_runner_->PostTask(
1309 FROM_HERE, 1308 FROM_HERE,
1310 base::Bind(&RunVRDisplayInfoCallback, callback, base::Passed(&info))); 1309 base::Bind(&RunVRDisplayInfoCallback, callback, base::Passed(&info)));
1311 } 1310 }
1312 1311
1313 } // namespace vr_shell 1312 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698