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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 platform_viewport_->ReleaseCapture(); | 82 platform_viewport_->ReleaseCapture(); |
83 break; | 83 break; |
84 default: | 84 default: |
85 break; | 85 break; |
86 } | 86 } |
87 | 87 |
88 if (waiting_for_event_ack_ && IsRateLimitedEventType(ui_event)) | 88 if (waiting_for_event_ack_ && IsRateLimitedEventType(ui_event)) |
89 return false; | 89 return false; |
90 | 90 |
91 client()->OnEvent( | 91 client()->OnEvent( |
92 TypeConverter<EventPtr, ui::Event>::ConvertFrom(*ui_event), | 92 Event::From(*ui_event), |
93 base::Bind(&NativeViewportImpl::AckEvent, | 93 base::Bind(&NativeViewportImpl::AckEvent, weak_factory_.GetWeakPtr())); |
94 weak_factory_.GetWeakPtr())); | |
95 waiting_for_event_ack_ = true; | 94 waiting_for_event_ack_ = true; |
96 return false; | 95 return false; |
97 } | 96 } |
98 | 97 |
99 void NativeViewportImpl::OnDestroyed() { | 98 void NativeViewportImpl::OnDestroyed() { |
100 client()->OnDestroyed(); | 99 client()->OnDestroyed(); |
101 } | 100 } |
102 | 101 |
103 void NativeViewportImpl::AckEvent() { | 102 void NativeViewportImpl::AckEvent() { |
104 waiting_for_event_ack_ = false; | 103 waiting_for_event_ack_ = false; |
105 } | 104 } |
106 | 105 |
107 } // namespace mojo | 106 } // namespace mojo |
108 | 107 |
OLD | NEW |