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

Side by Side Diff: content/common/input/generic_input_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: Cleanup Created 7 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 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.
4
5 #include "content/common/input/generic_input_event.h"
6
7 #include "content/common/input_messages.h"
8 #include "ipc/ipc_message.h"
9
10 namespace content {
11
12 GenericInputEvent::GenericInputEvent(int64 id)
13 : InputEvent(GENERIC, ACK_NOT_REQUIRED, id) {}
14
15 GenericInputEvent::~GenericInputEvent() {}
16
17 scoped_ptr<GenericInputEvent> GenericInputEvent::Create() {
18 return make_scoped_ptr(new GenericInputEvent(0));
19 }
20
21 scoped_ptr<GenericInputEvent> GenericInputEvent::Create(
22 int64 id, scoped_ptr<IPC::Message> message) {
23 DCHECK(message);
24 DCHECK_EQ(InputMsgStart, IPC_MESSAGE_ID_CLASS(message->type()));
25 scoped_ptr<GenericInputEvent> event(new GenericInputEvent(id));
26 event->message = message.Pass();
27 return event.Pass();
28 }
29
30 const GenericInputEvent* GenericInputEvent::EventCast(const InputEvent* event) {
31 DCHECK_EQ(InputEvent::GENERIC, event->type);
32 return static_cast<const GenericInputEvent*>(event);
33 }
34
35 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698