Chromium Code Reviews

Side by Side Diff: chrome/browser/android/vr_shell/vr_input_manager.cc

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Fix test issue Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 "chrome/browser/android/vr_shell/vr_input_manager.h" 5 #include "chrome/browser/android/vr_shell/vr_input_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 88 matching lines...)
99 rwh->ForwardMouseEvent(mouse_event); 99 rwh->ForwardMouseEvent(mouse_event);
100 } 100 }
101 101
102 void VrInputManager::ForwardKeyboardEvent( 102 void VrInputManager::ForwardKeyboardEvent(
103 const content::NativeWebKeyboardEvent& keyboard_event) { 103 const content::NativeWebKeyboardEvent& keyboard_event) {
104 content::RenderWidgetHostView* rwhv = 104 content::RenderWidgetHostView* rwhv =
105 web_contents_->GetRenderWidgetHostView(); 105 web_contents_->GetRenderWidgetHostView();
106 if (rwhv == nullptr) 106 if (rwhv == nullptr)
107 return; 107 return;
108 content::RenderWidgetHost* rwh = rwhv->GetRenderWidgetHost(); 108 content::RenderWidgetHost* rwh = rwhv->GetRenderWidgetHost();
109 ui::LatencyInfo latency_info(ui::SourceEventType::KEY);
110 latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
109 if (rwh) 111 if (rwh)
110 rwh->ForwardKeyboardEvent(keyboard_event); 112 rwh->ForwardKeyboardEventWithLatencyInfo(keyboard_event, latency_info);
111 } 113 }
112 114
113 } // namespace vr_shell 115 } // namespace vr_shell
OLDNEW

Powered by Google App Engine