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

Unified Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2708613002: Add EventForwarder for routing touch events (Closed)
Patch Set: EventForwarder... Created 3 years, 9 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
« no previous file with comments | « content/browser/web_contents/web_contents_view_android.h ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_android.cc
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index eed15aa9d3d3221af5a8ee13ab78e681e0e9bdf6..7129cc9e4eafa201090293faec300dbb1039da29 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -10,15 +10,16 @@
#include "cc/layers/layer.h"
#include "content/browser/android/content_view_core_impl.h"
#include "content/browser/frame_host/interstitial_page_impl.h"
-#include "content/browser/renderer_host/render_widget_host_view_android.h"
#include "content/browser/renderer_host/render_view_host_factory.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_view_android.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/drop_data.h"
#include "ui/android/overscroll_refresh_handler.h"
#include "ui/display/screen.h"
+#include "ui/events/android/motion_event_android.h"
#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/image/image_skia.h"
@@ -82,8 +83,8 @@ WebContentsViewAndroid::WebContentsViewAndroid(
: web_contents_(web_contents),
content_view_core_(NULL),
delegate_(delegate),
- synchronous_compositor_client_(nullptr) {
-}
+ view_(this),
+ synchronous_compositor_client_(nullptr) {}
WebContentsViewAndroid::~WebContentsViewAndroid() {
if (view_.GetLayer())
@@ -395,4 +396,11 @@ void WebContentsViewAndroid::TakeFocus(bool reverse) {
web_contents_->GetRenderWidgetHostView()->Focus();
}
+bool WebContentsViewAndroid::OnTouchEvent(const ui::MotionEventAndroid& event,
+ bool for_touch_handle) {
+ if (event.GetAction() == ui::MotionEventAndroid::ACTION_DOWN)
+ content_view_core_->OnTouchDown(event.GetJavaObject());
+ return false; // let the children handle the actual event.
+}
+
} // namespace content
« no previous file with comments | « content/browser/web_contents/web_contents_view_android.h ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698