OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "mojo/services/native_viewport/native_viewport_service.h" | 5 #include "mojo/services/native_viewport/native_viewport_service.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "mojo/public/bindings/allocation_scope.h" | 9 #include "mojo/public/bindings/allocation_scope.h" |
| 10 #include "mojo/public/shell/shell.mojom.h" |
10 #include "mojo/services/gles2/command_buffer_impl.h" | 11 #include "mojo/services/gles2/command_buffer_impl.h" |
11 #include "mojo/services/native_viewport/geometry_conversions.h" | 12 #include "mojo/services/native_viewport/geometry_conversions.h" |
12 #include "mojo/services/native_viewport/native_viewport.h" | 13 #include "mojo/services/native_viewport/native_viewport.h" |
13 #include "mojom/native_viewport.h" | 14 #include "mojo/services/native_viewport/native_viewport.mojom.h" |
14 #include "mojom/shell.h" | |
15 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace services { | 18 namespace services { |
19 namespace { | 19 namespace { |
20 | 20 |
21 bool IsRateLimitedEventType(ui::Event* event) { | 21 bool IsRateLimitedEventType(ui::Event* event) { |
22 return event->type() == ui::ET_MOUSE_MOVED || | 22 return event->type() == ui::ET_MOUSE_MOVED || |
23 event->type() == ui::ET_MOUSE_DRAGGED || | 23 event->type() == ui::ET_MOUSE_DRAGGED || |
24 event->type() == ui::ET_TOUCH_MOVED; | 24 event->type() == ui::ET_TOUCH_MOVED; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 base::MessageLoopForUI loop; | 203 base::MessageLoopForUI loop; |
204 mojo::Application app(shell_handle); | 204 mojo::Application app(shell_handle); |
205 app.AddServiceFactory( | 205 app.AddServiceFactory( |
206 new mojo::ServiceFactory<mojo::services::NativeViewportImpl, | 206 new mojo::ServiceFactory<mojo::services::NativeViewportImpl, |
207 mojo::shell::Context>); | 207 mojo::shell::Context>); |
208 loop.Run(); | 208 loop.Run(); |
209 return MOJO_RESULT_OK; | 209 return MOJO_RESULT_OK; |
210 } | 210 } |
211 | 211 |
212 #endif // !OS_ANDROID | 212 #endif // !OS_ANDROID |
OLD | NEW |