| Index: content/browser/renderer_host/render_widget_host_view_aura.cc
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| index 2f27455a8569096ecb3167f748ae9dedebffbcd1..98e43acafdaeabc497f4bed45dee4d7123f8a7ae 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| @@ -32,6 +32,8 @@
|
| #include "content/browser/renderer_host/web_input_event_aura.h"
|
| #include "content/common/gpu/client/gl_helper.h"
|
| #include "content/common/gpu/gpu_messages.h"
|
| +#include "content/common/input/input_event.h"
|
| +#include "content/common/input/web_input_event_payload.h"
|
| #include "content/common/view_messages.h"
|
| #include "content/port/browser/render_widget_host_view_frame_subscriber.h"
|
| #include "content/port/browser/render_widget_host_view_port.h"
|
| @@ -88,6 +90,7 @@ using gfx::RectToSkIRect;
|
| using gfx::SkIRectToRect;
|
|
|
| using WebKit::WebScreenInfo;
|
| +using WebKit::WebInputEvent;
|
| using WebKit::WebTouchEvent;
|
|
|
| namespace content {
|
| @@ -2104,6 +2107,54 @@ void RenderWidgetHostViewAura::ProcessAckedTouchEvent(
|
| }
|
| }
|
|
|
| +void RenderWidgetHostViewAura::QueueInputEventToPlatform(
|
| + const InputEvent& event) {
|
| + aura::RootWindow* root_window = window_->GetRootWindow();
|
| + if (!root_window)
|
| + return;
|
| +
|
| + aura::RootWindowHostDelegate* root_window_host_delegate =
|
| + root_window->AsRootWindowHostDelegate();
|
| +
|
| + DCHECK(event.valid());
|
| + DCHECK_EQ(InputEvent::Payload::WEB_INPUT_EVENT, event.payload()->GetType());
|
| +
|
| + const WebInputEventPayload* payload =
|
| + WebInputEventPayload::Cast(event.payload());
|
| + const WebInputEvent* web_event = payload->web_event();
|
| + if (WebInputEvent::isTouchEventType(web_event->type)) {
|
| + ScopedVector<ui::TouchEvent> events;
|
| +
|
| + const WebTouchEvent* web_touch =
|
| + static_cast<const WebTouchEvent*>(web_event);
|
| +
|
| + TouchEventWithLatencyInfo touch_with_latency(
|
| + *web_touch, payload->latency_info());
|
| +
|
| + // SyntheticGesture may skip calculating screenPosition, so we will fill it
|
| + // in here. "screenPosition" is converted from "position".
|
| + const unsigned num_touches = touch_with_latency.event.touchesLength;
|
| + for (unsigned i = 0; i < num_touches; ++ i) {
|
| + WebKit::WebTouchPoint* point = &touch_with_latency.event.touches[i];
|
| + gfx::Point position(point->position.x, point->position.y);
|
| + aura::Window::ConvertPointToTarget(window_, root_window, &position);
|
| + root_window->ConvertPointToHost(&position);
|
| + point->screenPosition.x = position.x();
|
| + point->screenPosition.y = position.y();
|
| + }
|
| +
|
| + if (!MakeUITouchEventsFromWebTouchEvents(touch_with_latency, &events,
|
| + SCREEN_COORDINATES))
|
| + return;
|
| +
|
| + for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(),
|
| + end = events.end(); iter != end; ++iter) {
|
| + root_window_host_delegate->OnHostTouchEvent(*iter);
|
| + }
|
| + } else
|
| + NOTREACHED(); // FIXME: implement other types (MouseWheel?)
|
| +}
|
| +
|
| SyntheticGesture* RenderWidgetHostViewAura::CreateSmoothScrollGesture(
|
| bool scroll_down,
|
| int pixels_to_scroll,
|
|
|