OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/native_viewport/native_viewport_impl.h" | 5 #include "services/native_viewport/native_viewport_impl.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void NativeViewportImpl::SetSize(mojo::SizePtr size) { | 83 void NativeViewportImpl::SetSize(mojo::SizePtr size) { |
84 platform_viewport_->SetBounds(gfx::Rect(size.To<gfx::Size>())); | 84 platform_viewport_->SetBounds(gfx::Rect(size.To<gfx::Size>())); |
85 } | 85 } |
86 | 86 |
87 void NativeViewportImpl::GetContextProvider( | 87 void NativeViewportImpl::GetContextProvider( |
88 mojo::InterfaceRequest<mojo::ContextProvider> request) { | 88 mojo::InterfaceRequest<mojo::ContextProvider> request) { |
89 context_provider_.Bind(request.Pass()); | 89 context_provider_.Bind(request.Pass()); |
90 } | 90 } |
91 | 91 |
92 void NativeViewportImpl::SetEventDispatcher( | 92 void NativeViewportImpl::SetEventDispatcher( |
93 mojo::NativeViewportEventDispatcherPtr dispatcher) { | 93 mojo::InterfaceHandle<mojo::NativeViewportEventDispatcher> dispatcher) { |
94 event_dispatcher_ = dispatcher.Pass(); | 94 event_dispatcher_ = |
| 95 mojo::NativeViewportEventDispatcherPtr::Create(std::move(dispatcher)); |
95 } | 96 } |
96 | 97 |
97 void NativeViewportImpl::OnMetricsChanged(mojo::ViewportMetricsPtr metrics) { | 98 void NativeViewportImpl::OnMetricsChanged(mojo::ViewportMetricsPtr metrics) { |
98 if (metrics_->Equals(*metrics)) | 99 if (metrics_->Equals(*metrics)) |
99 return; | 100 return; |
100 | 101 |
101 metrics_ = metrics.Pass(); | 102 metrics_ = metrics.Pass(); |
102 sent_metrics_ = false; | 103 sent_metrics_ = false; |
103 | 104 |
104 if (!metrics_callback_.is_null()) { | 105 if (!metrics_callback_.is_null()) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 160 |
160 void NativeViewportImpl::OnDestroyed() { | 161 void NativeViewportImpl::OnDestroyed() { |
161 delete this; | 162 delete this; |
162 } | 163 } |
163 | 164 |
164 void NativeViewportImpl::AckEvent(int32 pointer_id) { | 165 void NativeViewportImpl::AckEvent(int32 pointer_id) { |
165 pointers_waiting_on_ack_.erase(pointer_id); | 166 pointers_waiting_on_ack_.erase(pointer_id); |
166 } | 167 } |
167 | 168 |
168 } // namespace native_viewport | 169 } // namespace native_viewport |
OLD | NEW |