Chromium Code Reviews| 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 "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 Loading... | |
| 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 ui::LatencyInfo latency_info; |
| 176 // Don't know if I add ui_latency component to the latency_info or not. | |
| 177 //I can change function signiture and pass latency to it. | |
|
tdresser
2016/05/20 17:24:53
Add a TODO and link to the bug you filed.
Same th
sahel
2016/05/20 18:38:20
Done.
| |
| 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 Loading... | |
| 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 ui::LatencyInfo latency_info; |
| 224 //Don't know if I should add ui_latency componenet or not. | |
| 225 //I can change function signiture and pass latency to it. | |
| 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 ui::LatencyInfo latency_info; | |
| 233 //Don't know if I should add ui_latency componenet or not. | |
| 234 //I can change function signiture and pass latency to it. | |
| 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 // TODO(wjmaclean) When changing the zoom of a WebView child without also | 243 // TODO(wjmaclean) When changing the zoom of a WebView child without also |
| 234 // changing the zoom of the embedder (e.g. using WebView.setZoom()), we | 244 // changing the zoom of the embedder (e.g. using WebView.setZoom()), we |
| 235 // shouldn't propagate this change in the frame rect. We need to find a way | 245 // shouldn't propagate this change in the frame rect. We need to find a way |
| 236 // to detect when this happens. http://crbug.com/607978 | 246 // to detect when this happens. http://crbug.com/607978 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 | 336 |
| 327 if (parent) { | 337 if (parent) { |
| 328 return static_cast<RenderWidgetHostViewBase*>( | 338 return static_cast<RenderWidgetHostViewBase*>( |
| 329 parent->current_frame_host()->GetView()); | 339 parent->current_frame_host()->GetView()); |
| 330 } | 340 } |
| 331 | 341 |
| 332 return nullptr; | 342 return nullptr; |
| 333 } | 343 } |
| 334 | 344 |
| 335 } // namespace content | 345 } // namespace content |
| OLD | NEW |