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 // TODO: https://bugs.chromium.org/p/chromium/issues/detail?id=613628 |
|
tdresser
2016/05/20 18:45:53
And reformat TODOs here.
sahel
2016/05/20 19:03:28
Done.
| |
| 176 ui::LatencyInfo latency_info; | |
| 177 parent_view->ProcessMouseWheelEvent(resent_wheel_event, latency_info); | |
| 176 } else { | 178 } else { |
| 177 NOTIMPLEMENTED(); | 179 NOTIMPLEMENTED(); |
| 178 } | 180 } |
| 179 } | 181 } |
| 180 | 182 |
| 181 bool CrossProcessFrameConnector::HasFocus() { | 183 bool CrossProcessFrameConnector::HasFocus() { |
| 182 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView(); | 184 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView(); |
| 183 if (root_view) | 185 if (root_view) |
| 184 return root_view->HasFocus(); | 186 return root_view->HasFocus(); |
| 185 return false; | 187 return false; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 210 if (blink::WebInputEvent::isKeyboardEventType(event->type)) { | 212 if (blink::WebInputEvent::isKeyboardEventType(event->type)) { |
| 211 if (!parent_widget->GetLastKeyboardEvent()) | 213 if (!parent_widget->GetLastKeyboardEvent()) |
| 212 return; | 214 return; |
| 213 NativeWebKeyboardEvent keyboard_event( | 215 NativeWebKeyboardEvent keyboard_event( |
| 214 *parent_widget->GetLastKeyboardEvent()); | 216 *parent_widget->GetLastKeyboardEvent()); |
| 215 view_->ProcessKeyboardEvent(keyboard_event); | 217 view_->ProcessKeyboardEvent(keyboard_event); |
| 216 return; | 218 return; |
| 217 } | 219 } |
| 218 | 220 |
| 219 if (blink::WebInputEvent::isMouseEventType(event->type)) { | 221 if (blink::WebInputEvent::isMouseEventType(event->type)) { |
| 220 view_->ProcessMouseEvent(*static_cast<const blink::WebMouseEvent*>(event)); | 222 // TODO: https://bugs.chromium.org/p/chromium/issues/detail?id=613628 |
| 223 ui::LatencyInfo latency_info; | |
| 224 view_->ProcessMouseEvent(*static_cast<const blink::WebMouseEvent*>(event), | |
| 225 latency_info); | |
| 221 return; | 226 return; |
| 222 } | 227 } |
| 223 | 228 |
| 224 if (event->type == blink::WebInputEvent::MouseWheel) { | 229 if (event->type == blink::WebInputEvent::MouseWheel) { |
| 230 // TODO: https://bugs.chromium.org/p/chromium/issues/detail?id=613628 | |
| 231 ui::LatencyInfo latency_info; | |
| 225 view_->ProcessMouseWheelEvent( | 232 view_->ProcessMouseWheelEvent( |
| 226 *static_cast<const blink::WebMouseWheelEvent*>(event)); | 233 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info); |
| 227 return; | 234 return; |
| 228 } | 235 } |
| 229 } | 236 } |
| 230 | 237 |
| 231 void CrossProcessFrameConnector::OnFrameRectChanged( | 238 void CrossProcessFrameConnector::OnFrameRectChanged( |
| 232 const gfx::Rect& frame_rect) { | 239 const gfx::Rect& frame_rect) { |
| 233 // TODO(wjmaclean) When changing the zoom of a WebView child without also | 240 // 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 | 241 // 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 | 242 // 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 | 243 // to detect when this happens. http://crbug.com/607978 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 | 333 |
| 327 if (parent) { | 334 if (parent) { |
| 328 return static_cast<RenderWidgetHostViewBase*>( | 335 return static_cast<RenderWidgetHostViewBase*>( |
| 329 parent->current_frame_host()->GetView()); | 336 parent->current_frame_host()->GetView()); |
| 330 } | 337 } |
| 331 | 338 |
| 332 return nullptr; | 339 return nullptr; |
| 333 } | 340 } |
| 334 | 341 |
| 335 } // namespace content | 342 } // namespace content |
| OLD | NEW |