| OLD | NEW |
| 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 11 matching lines...) Expand all Loading... |
| 22 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 22 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 23 #include "third_party/WebKit/public/platform/WebGestureEvent.h" | 23 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
| 24 #include "third_party/WebKit/public/platform/WebLayer.h" | 24 #include "third_party/WebKit/public/platform/WebLayer.h" |
| 25 #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" | 25 #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" |
| 26 #include "third_party/WebKit/public/platform/WebSize.h" | 26 #include "third_party/WebKit/public/platform/WebSize.h" |
| 27 #include "third_party/WebKit/public/web/WebWidget.h" | 27 #include "third_party/WebKit/public/web/WebWidget.h" |
| 28 #include "ui/gfx/geometry/size_conversions.h" | 28 #include "ui/gfx/geometry/size_conversions.h" |
| 29 #include "ui/gl/gpu_preference.h" | 29 #include "ui/gl/gpu_preference.h" |
| 30 | 30 |
| 31 using blink::WebCanvas; | 31 using blink::WebCanvas; |
| 32 using blink::WebCoalescedInputEvent; |
| 32 using blink::WebCompositionUnderline; | 33 using blink::WebCompositionUnderline; |
| 33 using blink::WebCursorInfo; | 34 using blink::WebCursorInfo; |
| 34 using blink::WebGestureEvent; | 35 using blink::WebGestureEvent; |
| 35 using blink::WebInputEvent; | 36 using blink::WebInputEvent; |
| 36 using blink::WebInputEventResult; | 37 using blink::WebInputEventResult; |
| 37 using blink::WebMouseEvent; | 38 using blink::WebMouseEvent; |
| 38 using blink::WebMouseWheelEvent; | 39 using blink::WebMouseWheelEvent; |
| 39 using blink::WebPoint; | 40 using blink::WebPoint; |
| 40 using blink::WebRect; | 41 using blink::WebRect; |
| 41 using blink::WebSize; | 42 using blink::WebSize; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return; | 148 return; |
| 148 | 149 |
| 149 size_ = size; | 150 size_ = size; |
| 150 WebRect plugin_rect(0, 0, size_.width, size_.height); | 151 WebRect plugin_rect(0, 0, size_.width, size_.height); |
| 151 widget_->plugin()->ViewChanged(plugin_rect, plugin_rect, plugin_rect); | 152 widget_->plugin()->ViewChanged(plugin_rect, plugin_rect, plugin_rect); |
| 152 widget_->Invalidate(); | 153 widget_->Invalidate(); |
| 153 } | 154 } |
| 154 | 155 |
| 155 void themeChanged() override { NOTIMPLEMENTED(); } | 156 void themeChanged() override { NOTIMPLEMENTED(); } |
| 156 | 157 |
| 157 WebInputEventResult handleInputEvent(const WebInputEvent& event) override { | 158 WebInputEventResult handleInputEvent( |
| 159 const WebCoalescedInputEvent& coalesced_event) override { |
| 158 if (!widget_->plugin()) | 160 if (!widget_->plugin()) |
| 159 return WebInputEventResult::NotHandled; | 161 return WebInputEventResult::NotHandled; |
| 160 | 162 |
| 163 const WebInputEvent& event = coalesced_event.event(); |
| 164 |
| 161 // This cursor info is ignored, we always set the cursor directly from | 165 // This cursor info is ignored, we always set the cursor directly from |
| 162 // RenderWidgetFullscreenPepper::DidChangeCursor. | 166 // RenderWidgetFullscreenPepper::DidChangeCursor. |
| 163 WebCursorInfo cursor; | 167 WebCursorInfo cursor; |
| 164 | 168 |
| 165 // Pepper plugins do not accept gesture events. So do not send the gesture | 169 // Pepper plugins do not accept gesture events. So do not send the gesture |
| 166 // events directly to the plugin. Instead, try to convert them to equivalent | 170 // events directly to the plugin. Instead, try to convert them to equivalent |
| 167 // mouse events, and then send to the plugin. | 171 // mouse events, and then send to the plugin. |
| 168 if (WebInputEvent::isGestureEventType(event.type())) { | 172 if (WebInputEvent::isGestureEventType(event.type())) { |
| 169 bool result = false; | 173 bool result = false; |
| 170 const WebGestureEvent* gesture_event = | 174 const WebGestureEvent* gesture_event = |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() { | 380 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() { |
| 377 return active_url_; | 381 return active_url_; |
| 378 } | 382 } |
| 379 | 383 |
| 380 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() { | 384 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() { |
| 381 if (compositor_) | 385 if (compositor_) |
| 382 compositor_->setDeviceScaleFactor(device_scale_factor_); | 386 compositor_->setDeviceScaleFactor(device_scale_factor_); |
| 383 } | 387 } |
| 384 | 388 |
| 385 } // namespace content | 389 } // namespace content |
| OLD | NEW |