Index: content/common/input/web_platform_input_event.h |
diff --git a/content/common/input/web_platform_input_event.h b/content/common/input/web_platform_input_event.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ed2fb04d69f46885e2f7b0203066e5300df2d4ad |
--- /dev/null |
+++ b/content/common/input/web_platform_input_event.h |
@@ -0,0 +1,56 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_INPUT_WEB_PLATFORM_INPUT_EVENT_H_ |
+#define CONTENT_COMMON_INPUT_WEB_PLATFORM_INPUT_EVENT_H_ |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "content/common/content_export.h" |
+#include "content/common/input/input_event.h" |
+#include "ui/base/latency_info.h" |
+ |
+namespace WebKit { |
+class WebInputEvent; |
+} |
+ |
+namespace content { |
+ |
+// An event based on a WebKit::WebInputEvent. |
+class CONTENT_EXPORT WebPlatformInputEvent : public InputEvent { |
+ public: |
+ static scoped_ptr<WebPlatformInputEvent> Create(); |
+ static scoped_ptr<WebPlatformInputEvent> Create( |
+ int64 id, |
+ const WebKit::WebInputEvent& event, |
+ const ui::LatencyInfo& latency_info, |
+ bool is_keyboard_shortcut, |
+ bool creates_followup_events); |
+ |
+ virtual ~WebPlatformInputEvent(); |
+ |
+ void Initialize(const WebKit::WebInputEvent& event, |
+ const ui::LatencyInfo& latency_info, |
+ bool is_keyboard_shortcut); |
+ |
+ // WebKit::WebInputEvent does not provide a virtual destructor. |
+ struct WebInputEventDeleter { |
+ WebInputEventDeleter(); |
+ void operator()(WebKit::WebInputEvent* event) const; |
+ }; |
+ typedef scoped_ptr<WebKit::WebInputEvent, |
+ WebInputEventDeleter> ScopedWebInputEvent; |
+ |
+ ScopedWebInputEvent event; |
+ ui::LatencyInfo latency_info; |
+ bool is_keyboard_shortcut; |
+ |
+ static const WebPlatformInputEvent* EventCast(const InputEvent* event); |
+ |
+protected: |
+ explicit WebPlatformInputEvent(AckType ack_type, int64 id); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_INPUT_WEB_PLATFORM_INPUT_EVENT_H_ |