| Index: ui/platform_window/android/java/src/org/chromium/ui/PlatformWindowAndroid.java
|
| diff --git a/ui/platform_window/android/java/src/org/chromium/ui/PlatformWindowAndroid.java b/ui/platform_window/android/java/src/org/chromium/ui/PlatformWindowAndroid.java
|
| index 9c77fce65121c5d8513a3da562444f5a40ff429f..1ad52e43914e335ed4efb6306faa4130f7b57e51 100644
|
| --- a/ui/platform_window/android/java/src/org/chromium/ui/PlatformWindowAndroid.java
|
| +++ b/ui/platform_window/android/java/src/org/chromium/ui/PlatformWindowAndroid.java
|
| @@ -6,6 +6,8 @@ package org.chromium.ui;
|
|
|
| import android.app.Activity;
|
| import android.content.Context;
|
| +import android.graphics.Rect;
|
| +import android.util.Log;
|
| import android.view.KeyEvent;
|
| import android.view.MotionEvent;
|
| import android.view.Surface;
|
| @@ -18,6 +20,7 @@ import android.view.inputmethod.InputConnection;
|
| import org.chromium.base.annotations.CalledByNative;
|
| import org.chromium.base.annotations.JNINamespace;
|
|
|
| +
|
| /**
|
| * Exposes SurfaceView to native code.
|
| */
|
| @@ -48,6 +51,7 @@ public class PlatformWindowAndroid extends SurfaceView {
|
|
|
| final float density = context.getResources().getDisplayMetrics().density;
|
|
|
| + Log.w("auraclank", "PlatformWindowAndroid ctor");
|
| mSurfaceCallback = new SurfaceHolder.Callback() {
|
| @Override
|
| public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
| @@ -57,6 +61,7 @@ public class PlatformWindowAndroid extends SurfaceView {
|
|
|
| @Override
|
| public void surfaceCreated(SurfaceHolder holder) {
|
| + Log.w("auraclank", "!!! PlatformWindowAndroid - Surface created!!!");
|
| assert mNativeMojoViewport != 0;
|
| nativeSurfaceCreated(mNativeMojoViewport, holder.getSurface(), density);
|
| }
|
| @@ -79,6 +84,15 @@ public class PlatformWindowAndroid extends SurfaceView {
|
| }
|
|
|
| @Override
|
| + public void onWindowFocusChanged(boolean hasWindowFocus) {
|
| + super.onWindowFocusChanged(hasWindowFocus);
|
| + if (hasWindowFocus) {
|
| + requestFocusFromTouch();
|
| + requestFocus();
|
| + }
|
| + }
|
| +
|
| + @Override
|
| protected void onWindowVisibilityChanged(int visibility) {
|
| super.onWindowVisibilityChanged(visibility);
|
| if (visibility == View.VISIBLE) {
|
| @@ -88,6 +102,12 @@ public class PlatformWindowAndroid extends SurfaceView {
|
| }
|
|
|
| @Override
|
| + public void onFocusChanged(boolean gainedFocus, int direction, Rect previouslyFocusedRect) {
|
| + super.onFocusChanged(gainedFocus, direction, previouslyFocusedRect);
|
| + nativeFocusChanged(mNativeMojoViewport, gainedFocus);
|
| + }
|
| +
|
| + @Override
|
| public boolean onTouchEvent(MotionEvent event) {
|
| final int actionMasked = event.getActionMasked();
|
| if (actionMasked == MotionEvent.ACTION_POINTER_DOWN
|
| @@ -106,6 +126,25 @@ public class PlatformWindowAndroid extends SurfaceView {
|
| }
|
|
|
| @Override
|
| + public boolean onKeyUp(int keyCode, KeyEvent event) {
|
| + Log.w("auraclank", "KeyUp:keycode" + keyCode);
|
| + return false;
|
| + }
|
| +
|
| + @Override
|
| + public boolean onKeyDown(int keyCode, KeyEvent event) {
|
| + Log.w("auraclank", "KeyDown:keycode" + keyCode);
|
| + return false;
|
| + }
|
| +
|
| + @Override
|
| + public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
|
| + Log.w("auraclank", "onKeyMultiple:keycode" + keyCode);
|
| + return false;
|
| + }
|
| +
|
| +
|
| + @Override
|
| public boolean onCheckIsTextEditor() {
|
| return mImeController.isTextEditorType();
|
| }
|
| @@ -196,4 +235,6 @@ public class PlatformWindowAndroid extends SurfaceView {
|
|
|
| private static native boolean nativeKeyEvent(
|
| long nativePlatformWindowAndroid, boolean pressed, int keyCode, int unicodeCharacter);
|
| + private static native void nativeFocusChanged(
|
| + long nativePlatformWindowAndroid, boolean gainedFocus);
|
| }
|
|
|