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

Unified Diff: ui/android/event_handler.cc

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: lazy creation 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..51ab14b001b7781336e7e2dbe731cca42be08100
--- /dev/null
+++ b/ui/android/event_handler.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 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 "jni/EventHandler_jni.h"
+#include "ui/android/view_android.h"
+
+namespace ui {
+
+EventHandler::EventHandler(ui::ViewAndroid* view) : view_(view) { }
+
+void EventHandler::OnPhysicalBackingSizeChanged(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ int width,
+ int height) {
+ if (physical_width_pix_ == width && physical_height_pix_ == height)
+ return;
+ physical_width_pix_ = width;
+ physical_height_pix_ = height;
+
+ view_->OnPhysicalBackingSizeChanged(width, height);
+}
+
+int EventHandler::GetPhysicalBackingSizeWidthPix() {
+ return physical_width_pix_;
+}
+
+int EventHandler::GetPhysicalBackingSizeHeightPix() {
+ return physical_height_pix_;
+}
+
+bool RegisterEventHandler(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698