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_factory_ozone.h" | 5 #include "ui/events/ozone/event_factory_ozone.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
11 #include "ui/events/event_switches.h" | 11 #include "ui/events/event_switches.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 // static | 15 // static |
16 EventFactoryOzone* EventFactoryOzone::impl_ = NULL; | 16 EventFactoryOzone* EventFactoryOzone::impl_ = NULL; |
17 | 17 |
18 EventFactoryOzone::EventFactoryOzone() {} | 18 EventFactoryOzone::EventFactoryOzone() { |
| 19 CHECK(!impl_) << "There should only be a single EventFactoryOzone"; |
| 20 impl_ = this; |
| 21 } |
19 | 22 |
20 EventFactoryOzone::~EventFactoryOzone() {} | 23 EventFactoryOzone::~EventFactoryOzone() { |
| 24 CHECK_EQ(impl_, this); |
| 25 impl_ = NULL; |
| 26 } |
21 | 27 |
22 EventFactoryOzone* EventFactoryOzone::GetInstance() { | 28 EventFactoryOzone* EventFactoryOzone::GetInstance() { |
23 CHECK(impl_) << "No EventFactoryOzone implementation set."; | 29 CHECK(impl_) << "No EventFactoryOzone implementation set."; |
24 return impl_; | 30 return impl_; |
25 } | 31 } |
26 | 32 |
27 void EventFactoryOzone::SetInstance(EventFactoryOzone* impl) { impl_ = impl; } | |
28 | |
29 void EventFactoryOzone::StartProcessingEvents() {} | 33 void EventFactoryOzone::StartProcessingEvents() {} |
30 | 34 |
31 void EventFactoryOzone::WarpCursorTo(gfx::AcceleratedWidget widget, | 35 void EventFactoryOzone::WarpCursorTo(gfx::AcceleratedWidget widget, |
32 const gfx::PointF& location) { | 36 const gfx::PointF& location) { |
33 NOTIMPLEMENTED(); | 37 NOTIMPLEMENTED(); |
34 } | 38 } |
35 | 39 |
36 } // namespace ui | 40 } // namespace ui |
OLD | NEW |