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/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 11 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
12 #include "mojo/services/gles2/command_buffer_impl.h" | 12 #include "mojo/services/gles2/command_buffer_impl.h" |
13 #include "mojo/services/native_viewport/native_viewport.h" | 13 #include "mojo/services/native_viewport/native_viewport.h" |
14 #include "mojo/services/native_viewport/native_viewport.mojom.h" | |
15 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" | 14 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" |
16 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 15 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
| 16 #include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.
h" |
17 #include "ui/events/event.h" | 17 #include "ui/events/event.h" |
18 | 18 |
19 namespace mojo { | 19 namespace mojo { |
20 namespace services { | 20 namespace services { |
21 namespace { | 21 namespace { |
22 | 22 |
23 bool IsRateLimitedEventType(ui::Event* event) { | 23 bool IsRateLimitedEventType(ui::Event* event) { |
24 return event->type() == ui::ET_MOUSE_MOVED || | 24 return event->type() == ui::ET_MOUSE_MOVED || |
25 event->type() == ui::ET_MOUSE_DRAGGED || | 25 event->type() == ui::ET_MOUSE_DRAGGED || |
26 event->type() == ui::ET_TOUCH_MOVED; | 26 event->type() == ui::ET_TOUCH_MOVED; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 MOJO_NATIVE_VIEWPORT_EXPORT mojo::Application* | 157 MOJO_NATIVE_VIEWPORT_EXPORT mojo::Application* |
158 CreateNativeViewportService( | 158 CreateNativeViewportService( |
159 mojo::shell::Context* context, | 159 mojo::shell::Context* context, |
160 mojo::ScopedMessagePipeHandle service_provider_handle) { | 160 mojo::ScopedMessagePipeHandle service_provider_handle) { |
161 mojo::Application* app = new mojo::Application( | 161 mojo::Application* app = new mojo::Application( |
162 service_provider_handle.Pass()); | 162 service_provider_handle.Pass()); |
163 app->AddService<mojo::services::NativeViewportImpl>(context); | 163 app->AddService<mojo::services::NativeViewportImpl>(context); |
164 return app; | 164 return app; |
165 } | 165 } |
OLD | NEW |