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

Side by Side Diff: ui/latency/mojo/latency_info_struct_traits.cc

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Restrict to RawKeyDown and Char events on Android & Mac Created 3 years, 7 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
« no previous file with comments | « ui/latency/mojo/latency_info.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/latency/mojo/latency_info_struct_traits.h" 5 #include "ui/latency/mojo/latency_info_struct_traits.h"
6 6
7 #include "ipc/ipc_message_utils.h" 7 #include "ipc/ipc_message_utils.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 154
155 ui::mojom::SourceEventType UISourceEventTypeToMojo(ui::SourceEventType type) { 155 ui::mojom::SourceEventType UISourceEventTypeToMojo(ui::SourceEventType type) {
156 switch (type) { 156 switch (type) {
157 case ui::UNKNOWN: 157 case ui::UNKNOWN:
158 return ui::mojom::SourceEventType::UNKNOWN; 158 return ui::mojom::SourceEventType::UNKNOWN;
159 case ui::WHEEL: 159 case ui::WHEEL:
160 return ui::mojom::SourceEventType::WHEEL; 160 return ui::mojom::SourceEventType::WHEEL;
161 case ui::TOUCH: 161 case ui::TOUCH:
162 return ui::mojom::SourceEventType::TOUCH; 162 return ui::mojom::SourceEventType::TOUCH;
163 case ui::KEY_PRESS:
164 return ui::mojom::SourceEventType::KEY_PRESS;
163 case ui::OTHER: 165 case ui::OTHER:
164 return ui::mojom::SourceEventType::OTHER; 166 return ui::mojom::SourceEventType::OTHER;
165 } 167 }
166 NOTREACHED(); 168 NOTREACHED();
167 return ui::mojom::SourceEventType::UNKNOWN; 169 return ui::mojom::SourceEventType::UNKNOWN;
168 } 170 }
169 171
170 ui::SourceEventType MojoSourceEventTypeToUI(ui::mojom::SourceEventType type) { 172 ui::SourceEventType MojoSourceEventTypeToUI(ui::mojom::SourceEventType type) {
171 switch (type) { 173 switch (type) {
172 case ui::mojom::SourceEventType::UNKNOWN: 174 case ui::mojom::SourceEventType::UNKNOWN:
173 return ui::UNKNOWN; 175 return ui::UNKNOWN;
174 case ui::mojom::SourceEventType::WHEEL: 176 case ui::mojom::SourceEventType::WHEEL:
175 return ui::WHEEL; 177 return ui::WHEEL;
176 case ui::mojom::SourceEventType::TOUCH: 178 case ui::mojom::SourceEventType::TOUCH:
177 return ui::TOUCH; 179 return ui::TOUCH;
180 case ui::mojom::SourceEventType::KEY_PRESS:
181 return ui::KEY_PRESS;
178 case ui::mojom::SourceEventType::OTHER: 182 case ui::mojom::SourceEventType::OTHER:
179 return ui::OTHER; 183 return ui::OTHER;
180 } 184 }
181 NOTREACHED(); 185 NOTREACHED();
182 return ui::SourceEventType::UNKNOWN; 186 return ui::SourceEventType::UNKNOWN;
183 } 187 }
184 188
185 } // namespace 189 } // namespace
186 190
187 // static 191 // static
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 324 }
321 325
322 out->trace_id_ = data.trace_id(); 326 out->trace_id_ = data.trace_id();
323 out->coalesced_ = data.coalesced(); 327 out->coalesced_ = data.coalesced();
324 out->terminated_ = data.terminated(); 328 out->terminated_ = data.terminated();
325 out->source_event_type_ = MojoSourceEventTypeToUI(data.source_event_type()); 329 out->source_event_type_ = MojoSourceEventTypeToUI(data.source_event_type());
326 return true; 330 return true;
327 } 331 }
328 332
329 } // namespace mojo 333 } // namespace mojo
OLDNEW
« no previous file with comments | « ui/latency/mojo/latency_info.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698