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

Side by Side Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 1993383002: Adding Event.Latency.Browser.WheelUI, Passing latency_info to ProcessMouse/MouseWheelEvent functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "content/browser/frame_host/cross_process_frame_connector.h" 5 #include "content/browser/frame_host/cross_process_frame_connector.h"
6 6
7 #include "cc/surfaces/surface.h" 7 #include "cc/surfaces/surface.h"
8 #include "cc/surfaces/surface_manager.h" 8 #include "cc/surfaces/surface_manager.h"
9 #include "content/browser/compositor/surface_utils.h" 9 #include "content/browser/compositor/surface_utils.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // to a flag or otherwise refactored out when BrowserPlugin supporting 165 // to a flag or otherwise refactored out when BrowserPlugin supporting
166 // code is eventually removed (https://crbug.com/533069). 166 // code is eventually removed (https://crbug.com/533069).
167 resent_gesture_event.resendingPluginId = 1; 167 resent_gesture_event.resendingPluginId = 1;
168 ui::LatencyInfo latency_info; 168 ui::LatencyInfo latency_info;
169 parent_view->ProcessGestureEvent(resent_gesture_event, latency_info); 169 parent_view->ProcessGestureEvent(resent_gesture_event, latency_info);
170 } else if (event.type == blink::WebInputEvent::MouseWheel) { 170 } else if (event.type == blink::WebInputEvent::MouseWheel) {
171 blink::WebMouseWheelEvent resent_wheel_event; 171 blink::WebMouseWheelEvent resent_wheel_event;
172 memcpy(&resent_wheel_event, &event, sizeof(resent_wheel_event)); 172 memcpy(&resent_wheel_event, &event, sizeof(resent_wheel_event));
173 resent_wheel_event.x += offset_from_parent.x(); 173 resent_wheel_event.x += offset_from_parent.x();
174 resent_wheel_event.y += offset_from_parent.y(); 174 resent_wheel_event.y += offset_from_parent.y();
175 parent_view->ProcessMouseWheelEvent(resent_wheel_event); 175 // TODO(wjmaclean): Initialize latency info correctly for OOPIFs.
176 // https://crbug.com/613628
177 ui::LatencyInfo latency_info;
178 parent_view->ProcessMouseWheelEvent(resent_wheel_event, latency_info);
176 } else { 179 } else {
177 NOTIMPLEMENTED(); 180 NOTIMPLEMENTED();
178 } 181 }
179 } 182 }
180 183
181 bool CrossProcessFrameConnector::HasFocus() { 184 bool CrossProcessFrameConnector::HasFocus() {
182 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView(); 185 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView();
183 if (root_view) 186 if (root_view)
184 return root_view->HasFocus(); 187 return root_view->HasFocus();
185 return false; 188 return false;
(...skipping 24 matching lines...) Expand all
210 if (blink::WebInputEvent::isKeyboardEventType(event->type)) { 213 if (blink::WebInputEvent::isKeyboardEventType(event->type)) {
211 if (!parent_widget->GetLastKeyboardEvent()) 214 if (!parent_widget->GetLastKeyboardEvent())
212 return; 215 return;
213 NativeWebKeyboardEvent keyboard_event( 216 NativeWebKeyboardEvent keyboard_event(
214 *parent_widget->GetLastKeyboardEvent()); 217 *parent_widget->GetLastKeyboardEvent());
215 view_->ProcessKeyboardEvent(keyboard_event); 218 view_->ProcessKeyboardEvent(keyboard_event);
216 return; 219 return;
217 } 220 }
218 221
219 if (blink::WebInputEvent::isMouseEventType(event->type)) { 222 if (blink::WebInputEvent::isMouseEventType(event->type)) {
220 view_->ProcessMouseEvent(*static_cast<const blink::WebMouseEvent*>(event)); 223 // TODO(wjmaclean): Initialize latency info correctly for OOPIFs.
224 // https://crbug.com/613628
225 ui::LatencyInfo latency_info;
226 view_->ProcessMouseEvent(*static_cast<const blink::WebMouseEvent*>(event),
227 latency_info);
221 return; 228 return;
222 } 229 }
223 230
224 if (event->type == blink::WebInputEvent::MouseWheel) { 231 if (event->type == blink::WebInputEvent::MouseWheel) {
232 // TODO(wjmaclean): Initialize latency info correctly for OOPIFs.
233 // https://crbug.com/613628
234 ui::LatencyInfo latency_info;
225 view_->ProcessMouseWheelEvent( 235 view_->ProcessMouseWheelEvent(
226 *static_cast<const blink::WebMouseWheelEvent*>(event)); 236 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info);
227 return; 237 return;
228 } 238 }
229 } 239 }
230 240
231 void CrossProcessFrameConnector::OnFrameRectChanged( 241 void CrossProcessFrameConnector::OnFrameRectChanged(
232 const gfx::Rect& frame_rect) { 242 const gfx::Rect& frame_rect) {
233 if (!frame_rect.size().IsEmpty()) 243 if (!frame_rect.size().IsEmpty())
234 SetRect(frame_rect); 244 SetRect(frame_rect);
235 } 245 }
236 246
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 331
322 if (parent) { 332 if (parent) {
323 return static_cast<RenderWidgetHostViewBase*>( 333 return static_cast<RenderWidgetHostViewBase*>(
324 parent->current_frame_host()->GetView()); 334 parent->current_frame_host()->GetView());
325 } 335 }
326 336
327 return nullptr; 337 return nullptr;
328 } 338 }
329 339
330 } // namespace content 340 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698