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

Unified Diff: content/common/input/generic_event.cc

Issue 19624005: Add InputEvent and EventPacket types for batched input delivery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separate InputEvent types for events based on WebKit::WebInputEvent Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/common/input/generic_event.cc
diff --git a/content/common/input/generic_event.cc b/content/common/input/generic_event.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7504d2bb78c6d282369b9cb5e06e4c7835d2d855
--- /dev/null
+++ b/content/common/input/generic_event.cc
@@ -0,0 +1,30 @@
+// 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.
+
+#include "content/common/input/generic_event.h"
+
+#include "ipc/ipc_message.h"
+
+namespace content {
+
+GenericEvent::GenericEvent(int64 id)
+ : InputEvent(InputEvent::GENERIC, id) {}
+
+scoped_ptr<GenericEvent> GenericEvent::Create() {
+ return make_scoped_ptr(new GenericEvent(0));
+}
+
+scoped_ptr<GenericEvent> GenericEvent::Create(
+ int64 id, scoped_ptr<IPC::Message> message) {
+ scoped_ptr<GenericEvent> event(new GenericEvent(id));
+ event->message = message.Pass();
+ return event.Pass();
+}
+
+const GenericEvent* GenericEvent::EventCast(const InputEvent* event) {
+ DCHECK_EQ(InputEvent::GENERIC, event->type);
+ return static_cast<const GenericEvent*>(event);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698