Chromium Code Reviews| Index: ui/android/java/src/org/chromium/ui/base/EventHandler.java |
| diff --git a/ui/android/java/src/org/chromium/ui/base/EventHandler.java b/ui/android/java/src/org/chromium/ui/base/EventHandler.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..58db04190089067770846bc3cab700eedab189da |
| --- /dev/null |
| +++ b/ui/android/java/src/org/chromium/ui/base/EventHandler.java |
| @@ -0,0 +1,28 @@ |
| +// 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. |
| + |
| +package org.chromium.ui.base; |
| + |
| +import org.chromium.base.annotations.JNINamespace; |
| + |
| +/** |
| + * Class used to forward view, input events down to native. |
| + */ |
| +@JNINamespace("ui") |
| +public class EventHandler { |
|
boliu
2016/12/06 23:15:46
should add a comment that the java object can only
Jinsuk Kim
2016/12/07 12:36:28
Done.
|
| + private final long mNativeView; |
| + |
| + public EventHandler(long nativeView) { |
| + mNativeView = nativeView; |
| + nativeSetEventHandler(mNativeView); |
| + } |
| + |
| + public void onPhysicalBackingSizeChanged(int width, int height) { |
| + nativeOnPhysicalBackingSizeChanged(mNativeView, width, height); |
| + } |
| + |
| + private static native void nativeSetEventHandler(long viewAndroid); |
| + private static native void nativeOnPhysicalBackingSizeChanged(long viewAndroid, |
| + int width, int height); |
| +} |