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

Side by Side Diff: content/renderer/render_widget_fullscreen_pepper.cc

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Fixed compile failures. 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 (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/renderer/render_widget_fullscreen_pepper.h" 5 #include "content/renderer/render_widget_fullscreen_pepper.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 default: 93 default:
94 return WebMouseEvent(); 94 return WebMouseEvent();
95 } 95 }
96 96
97 WebMouseEvent mouse(type, gesture.modifiers() | WebInputEvent::LeftButtonDown, 97 WebMouseEvent mouse(type, gesture.modifiers() | WebInputEvent::LeftButtonDown,
98 gesture.timeStampSeconds()); 98 gesture.timeStampSeconds());
99 mouse.button = WebMouseEvent::Button::Left; 99 mouse.button = WebMouseEvent::Button::Left;
100 mouse.clickCount = (mouse.type() == WebInputEvent::MouseDown || 100 mouse.clickCount = (mouse.type() == WebInputEvent::MouseDown ||
101 mouse.type() == WebInputEvent::MouseUp); 101 mouse.type() == WebInputEvent::MouseUp);
102 102
103 mouse.x = gesture.x; 103 mouse.position.x = gesture.x;
104 mouse.y = gesture.y; 104 mouse.position.y = gesture.y;
105 mouse.globalX = gesture.globalX; 105 mouse.screenPosition.x = gesture.globalX;
106 mouse.globalY = gesture.globalY; 106 mouse.screenPosition.y = gesture.globalY;
107 107
108 return mouse; 108 return mouse;
109 } 109 }
110 110
111 FullscreenMouseLockDispatcher::FullscreenMouseLockDispatcher( 111 FullscreenMouseLockDispatcher::FullscreenMouseLockDispatcher(
112 RenderWidgetFullscreenPepper* widget) : widget_(widget) { 112 RenderWidgetFullscreenPepper* widget) : widget_(widget) {
113 } 113 }
114 114
115 FullscreenMouseLockDispatcher::~FullscreenMouseLockDispatcher() { 115 FullscreenMouseLockDispatcher::~FullscreenMouseLockDispatcher() {
116 } 116 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // mouse events, and then send to the plugin. 169 // mouse events, and then send to the plugin.
170 if (WebInputEvent::isGestureEventType(event.type())) { 170 if (WebInputEvent::isGestureEventType(event.type())) {
171 bool result = false; 171 bool result = false;
172 const WebGestureEvent* gesture_event = 172 const WebGestureEvent* gesture_event =
173 static_cast<const WebGestureEvent*>(&event); 173 static_cast<const WebGestureEvent*>(&event);
174 switch (event.type()) { 174 switch (event.type()) {
175 case WebInputEvent::GestureTap: { 175 case WebInputEvent::GestureTap: {
176 WebMouseEvent mouse(WebInputEvent::MouseMove, 176 WebMouseEvent mouse(WebInputEvent::MouseMove,
177 gesture_event->modifiers(), 177 gesture_event->modifiers(),
178 gesture_event->timeStampSeconds()); 178 gesture_event->timeStampSeconds());
179 mouse.x = gesture_event->x; 179 mouse.position.x = gesture_event->x;
180 mouse.y = gesture_event->y; 180 mouse.position.y = gesture_event->y;
181 mouse.globalX = gesture_event->globalX; 181 mouse.screenPosition.x = gesture_event->globalX;
182 mouse.globalY = gesture_event->globalY; 182 mouse.screenPosition.y = gesture_event->globalY;
183 mouse.movementX = 0; 183 mouse.movementX = 0;
184 mouse.movementY = 0; 184 mouse.movementY = 0;
185 result |= widget_->plugin()->HandleInputEvent(mouse, &cursor); 185 result |= widget_->plugin()->HandleInputEvent(mouse, &cursor);
186 186
187 mouse.setType(WebInputEvent::MouseDown); 187 mouse.setType(WebInputEvent::MouseDown);
188 mouse.button = WebMouseEvent::Button::Left; 188 mouse.button = WebMouseEvent::Button::Left;
189 mouse.clickCount = gesture_event->data.tap.tapCount; 189 mouse.clickCount = gesture_event->data.tap.tapCount;
190 result |= widget_->plugin()->HandleInputEvent(mouse, &cursor); 190 result |= widget_->plugin()->HandleInputEvent(mouse, &cursor);
191 191
192 mouse.setType(WebInputEvent::MouseUp); 192 mouse.setType(WebInputEvent::MouseUp);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() { 376 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() {
377 return active_url_; 377 return active_url_;
378 } 378 }
379 379
380 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() { 380 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() {
381 if (compositor_) 381 if (compositor_)
382 compositor_->setDeviceScaleFactor(device_scale_factor_); 382 compositor_->setDeviceScaleFactor(device_scale_factor_);
383 } 383 }
384 384
385 } // namespace content 385 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698