Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: mojo/services/native_viewport/native_viewport_impl.cc

Issue 507173003: Change TypeConverter<X,Y>::ConvertFrom and ConvertTo into a single symmetric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698