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

Unified Diff: ui/android/event_handler.cc

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: addressed comments Created 4 years 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: ui/android/event_handler.cc
diff --git a/ui/android/event_handler.cc b/ui/android/event_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b4bd58436ff815d9d5b758051d4cc4f3390da50c
--- /dev/null
+++ b/ui/android/event_handler.cc
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/android/event_handler.h"
+
+#include "base/android/scoped_java_ref.h"
+#include "jni/EventHandler_jni.h"
+#include "ui/android/view_android.h"
+
+using base::android::JavaParamRef;
+using base::android::ScopedJavaLocalRef;
+
+namespace ui {
+
+// static
+void OnPhysicalBackingSizeChanged(JNIEnv* env,
+ const JavaParamRef<jclass>& jcaller,
+ jlong native_view,
+ int width,
+ int height) {
+ ViewAndroid* view_android = reinterpret_cast<ViewAndroid*>(native_view);
+ view_android->OnPhysicalBackingSizeChanged(width, height);
+}
+
+void OnDestroyNativeView(JNIEnv* env,
+ const ScopedJavaLocalRef<jobject>& event_handler) {
+ Java_EventHandler_onDestroyNativeView(env, event_handler);
+}
+
+bool RegisterEventHandler(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698