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_event.h" |
| 6 |
| 7 #include "ipc/ipc_message.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 GenericEvent::GenericEvent(int64 id) |
| 12 : InputEvent(InputEvent::GENERIC, id) {} |
| 13 |
| 14 scoped_ptr<GenericEvent> GenericEvent::Create() { |
| 15 return make_scoped_ptr(new GenericEvent(0)); |
| 16 } |
| 17 |
| 18 scoped_ptr<GenericEvent> GenericEvent::Create( |
| 19 int64 id, scoped_ptr<IPC::Message> message) { |
| 20 scoped_ptr<GenericEvent> event(new GenericEvent(id)); |
| 21 event->message = message.Pass(); |
| 22 return event.Pass(); |
| 23 } |
| 24 |
| 25 const GenericEvent* GenericEvent::EventCast(const InputEvent* event) { |
| 26 DCHECK_EQ(InputEvent::GENERIC, event->type); |
| 27 return static_cast<const GenericEvent*>(event); |
| 28 } |
| 29 |
| 30 } // namespace content |
OLD | NEW |