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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 1308273003: Resend unconsumed scroll update from guest back to embedder (WebView Scroll Bubble). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor to avoid changing RenderWidgetHostImpl's interface. Created 5 years, 3 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/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index bb41b7e34347d8c758b9070b78dae2314bf9bcc9..12bdfc1a5d24a09ae29fa3afd7db20347d5dbc9d 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -459,6 +459,33 @@ bool BrowserPluginGuest::StopFinding(StopFindAction action) {
return delegate_->StopFinding(action);
}
+void BrowserPluginGuest::ResendEventToEmbedder(
+ const blink::WebInputEvent& event) {
+ if (!attached() || !owner_web_contents_)
+ return;
+
+ DCHECK(browser_plugin_instance_id_);
+ RenderWidgetHostImpl* host =
+ embedder_web_contents()->GetMainFrame()->GetRenderWidgetHost();
+
+ if (event.type == blink::WebInputEvent::GestureScrollUpdate) {
+ blink::WebGestureEvent resent_gesture_event;
+ memcpy(&resent_gesture_event, &event, sizeof(blink::WebGestureEvent));
Charlie Reis 2015/09/18 04:30:36 Sigh. memcpy is pretty dangerous in general, and
wjmaclean 2015/09/18 15:30:57 Acknowledged. I used it based on seeing the patte
+ // Mark the resend source with the browser plugin's instance id, so the
+ // correct browser_plugin will know to ignore the event.
+ resent_gesture_event.resendingPluginId = browser_plugin_instance_id_;
+ host->ForwardGestureEvent(resent_gesture_event);
+ } else if (event.type == blink::WebInputEvent::MouseWheel) {
+ blink::WebMouseWheelEvent resent_wheel_event;
+ memcpy(&resent_wheel_event, &event, sizeof(blink::WebMouseWheelEvent));
+ resent_wheel_event.resendingPluginId = browser_plugin_instance_id_;
+ host->ForwardWheelEvent(resent_wheel_event);
+ } else {
+ NOTIMPLEMENTED();
+ }
+
+}
+
WebContentsImpl* BrowserPluginGuest::GetWebContents() const {
return static_cast<WebContentsImpl*>(web_contents());
}

Powered by Google App Engine
This is Rietveld 408576698