OLD | NEW |
(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 |
OLD | NEW |