| 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 "mojo/services/native_viewport/native_viewport_impl.h" | 5 #include "mojo/services/native_viewport/native_viewport_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.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" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 platform_viewport_->ReleaseCapture(); | 111 platform_viewport_->ReleaseCapture(); |
| 112 break; | 112 break; |
| 113 default: | 113 default: |
| 114 break; | 114 break; |
| 115 } | 115 } |
| 116 | 116 |
| 117 if (waiting_for_event_ack_ && IsRateLimitedEventType(ui_event)) | 117 if (waiting_for_event_ack_ && IsRateLimitedEventType(ui_event)) |
| 118 return false; | 118 return false; |
| 119 | 119 |
| 120 client()->OnEvent( | 120 client()->OnEvent( |
| 121 TypeConverter<EventPtr, ui::Event>::ConvertFrom(*ui_event), | 121 Event::From(*ui_event), |
| 122 base::Bind(&NativeViewportImpl::AckEvent, | 122 base::Bind(&NativeViewportImpl::AckEvent, weak_factory_.GetWeakPtr())); |
| 123 weak_factory_.GetWeakPtr())); | |
| 124 waiting_for_event_ack_ = true; | 123 waiting_for_event_ack_ = true; |
| 125 return false; | 124 return false; |
| 126 } | 125 } |
| 127 | 126 |
| 128 void NativeViewportImpl::OnDestroyed() { | 127 void NativeViewportImpl::OnDestroyed() { |
| 129 client()->OnDestroyed(); | 128 client()->OnDestroyed(); |
| 130 } | 129 } |
| 131 | 130 |
| 132 void NativeViewportImpl::AckEvent() { | 131 void NativeViewportImpl::AckEvent() { |
| 133 waiting_for_event_ack_ = false; | 132 waiting_for_event_ack_ = false; |
| 134 } | 133 } |
| 135 | 134 |
| 136 } // namespace mojo | 135 } // namespace mojo |
| 137 | 136 |
| OLD | NEW |