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

Unified Diff: content/browser/renderer_host/render_widget_host_input_event_router.cc

Issue 2652643004: Make PageScaleFactor work for oopif subframes.
Patch Set: Put function prototype in correct place. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_input_event_router.cc
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc
index cb96ee2baaebbe5c11a0de76ae583bf83fb0c90c..888dfd7d0d1991edc3084110ae3917e4770e6cdc 100644
--- a/content/browser/renderer_host/render_widget_host_input_event_router.cc
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc
@@ -35,6 +35,12 @@ blink::WebGestureEvent DummyGestureScrollUpdate(double timeStampSeconds) {
timeStampSeconds);
}
+bool IsGesturePinchEvent(const blink::WebGestureEvent* event) {
+ return event->type() == blink::WebInputEvent::GesturePinchBegin ||
+ event->type() == blink::WebInputEvent::GesturePinchUpdate ||
+ event->type() == blink::WebInputEvent::GesturePinchEnd;
+}
+
} // anonymous namespace
namespace content {
@@ -689,6 +695,18 @@ void RenderWidgetHostInputEventRouter::RouteTouchscreenGestureEvent(
if (in_touchscreen_gesture_pinch_) {
root_view->ProcessGestureEvent(*event, latency);
+ if (IsGesturePinchEvent(event)) {
+ // Broadcast the pinch events to all subframes so they can update their
+ // PageScales with the deltas in the events. We don't broadcast to
+ // RenderWidgetHostViewGuest as it has a separate mechanism for
+ // propagating page scale.
+ for (auto entry : owner_map_) {
+ if (entry.second != root_view &&
+ !entry.second->IsRenderWidgetHostViewGuest()) {
+ entry.second->ProcessGestureEvent(*event, latency);
+ }
+ }
+ }
if (event->type() == blink::WebInputEvent::GesturePinchEnd) {
in_touchscreen_gesture_pinch_ = false;
// If the root view wasn't already receiving the gesture stream, then we
« no previous file with comments | « content/browser/renderer_host/render_widget_host_delegate.h ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698