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/input_event.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 InputEvent::InputEvent() |
| 12 : id_(0) {} |
| 13 |
| 14 InputEvent::~InputEvent() {} |
| 15 |
| 16 scoped_ptr<InputEvent> InputEvent::Create(int64 id, |
| 17 scoped_ptr<Payload> payload) { |
| 18 scoped_ptr<InputEvent> event(new InputEvent()); |
| 19 event->Initialize(id, payload.Pass()); |
| 20 return event.Pass(); |
| 21 } |
| 22 |
| 23 void InputEvent::Initialize(int64 id, scoped_ptr<Payload> payload) { |
| 24 DCHECK(!valid()) << "InputEvent already initialized."; |
| 25 id_ = id; |
| 26 payload_ = payload.Pass(); |
| 27 DCHECK(valid()) << "InputEvent initialization failed."; |
| 28 } |
| 29 |
| 30 } // namespace content |
OLD | NEW |