| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/events/ozone/event_converter_ozone.h" | 5 #include "ui/events/ozone/event_converter_ozone.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" |
| 8 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 9 #include "base/message_loop/message_pump_ozone.h" | 10 #include "base/message_loop/message_pump_ozone.h" |
| 10 #include "ui/events/event.h" | 11 #include "ui/events/event.h" |
| 11 | 12 |
| 12 namespace { | 13 namespace { |
| 13 | 14 |
| 14 void DispatchEventHelper(scoped_ptr<ui::Event> key) { | 15 void DispatchEventHelper(scoped_ptr<ui::Event> key) { |
| 16 TRACE_EVENT1("ozone", "DispatchEventHelper", "type", key->type()); |
| 15 base::MessagePumpOzone::Current()->Dispatch(key.get()); | 17 base::MessagePumpOzone::Current()->Dispatch(key.get()); |
| 16 } | 18 } |
| 17 | 19 |
| 18 } // namespace | 20 } // namespace |
| 19 | 21 |
| 20 namespace ui { | 22 namespace ui { |
| 21 | 23 |
| 22 EventConverterOzone::EventConverterOzone() { | 24 EventConverterOzone::EventConverterOzone() { |
| 23 } | 25 } |
| 24 | 26 |
| 25 EventConverterOzone::~EventConverterOzone() { | 27 EventConverterOzone::~EventConverterOzone() { |
| 26 } | 28 } |
| 27 | 29 |
| 28 void EventConverterOzone::DispatchEvent(scoped_ptr<ui::Event> event) { | 30 void EventConverterOzone::DispatchEvent(scoped_ptr<ui::Event> event) { |
| 29 base::MessageLoop::current()->PostTask( | 31 base::MessageLoop::current()->PostTask( |
| 30 FROM_HERE, base::Bind(&DispatchEventHelper, base::Passed(&event))); | 32 FROM_HERE, base::Bind(&DispatchEventHelper, base::Passed(&event))); |
| 31 } | 33 } |
| 32 | 34 |
| 33 } // namespace ui | 35 } // namespace ui |
| OLD | NEW |