Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / renderer / pepper / event_conversion.h
blob59b8678ada82654ecba2bf20f1e08ee3dfb18e76
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_PEPPER_EVENT_CONVERSION_H_
6 #define CONTENT_RENDERER_PEPPER_EVENT_CONVERSION_H_
8 #include <vector>
10 #include "base/memory/linked_ptr.h"
11 #include "ppapi/c/ppb_input_event.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h"
14 struct PP_InputEvent;
16 namespace ppapi {
17 struct InputEventData;
20 namespace blink {
21 class WebGamepads;
22 class WebInputEvent;
25 namespace content {
27 // Converts the given WebKit event to one or possibly multiple PP_InputEvents.
28 // The generated events will be filled into the given vector. On failure, no
29 // events will ge generated and the vector will be empty.
30 void CreateInputEventData(const blink::WebInputEvent& event,
31 std::vector<ppapi::InputEventData>* pp_events);
33 // Creates a WebInputEvent from the given PP_InputEvent. If it fails, returns
34 // NULL. The caller owns the created object on success.
35 blink::WebInputEvent* CreateWebInputEvent(const ppapi::InputEventData& event);
37 // Creates an array of WebInputEvents to make the given event look like a user
38 // input event on all platforms. |plugin_x| and |plugin_y| should be the
39 // coordinates of a point within the plugin's area on the page.
40 std::vector<linked_ptr<blink::WebInputEvent> > CreateSimulatedWebInputEvents(
41 const ppapi::InputEventData& event,
42 int plugin_x,
43 int plugin_y);
45 // Returns the PPAPI event class for the given WebKit event type. The given
46 // type should not be "Undefined" since there's no corresponding PPAPI class.
47 PP_InputEvent_Class ClassifyInputEvent(blink::WebInputEvent::Type type);
49 } // namespace content
51 #endif // CONTENT_RENDERER_PEPPER_EVENT_CONVERSION_H_