Chromium Code Reviews| Index: content/shell/android/java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java |
| diff --git a/content/shell/android/java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java b/content/shell/android/java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java |
| index 0e51e9d893b04fb4d382b038e74ed56bd5684c27..d4a76e771a337085e624b16a70cd35f678fc6d9d 100644 |
| --- a/content/shell/android/java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java |
| +++ b/content/shell/android/java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java |
| @@ -4,6 +4,8 @@ |
| package org.chromium.content_shell; |
| +import android.os.Build; |
| +import android.view.PointerIcon; |
| import android.view.ViewGroup; |
| import org.chromium.ui.base.ViewAndroidDelegate; |
| @@ -14,13 +16,27 @@ import org.chromium.ui.base.ViewAndroidDelegate; |
| */ |
| public class ShellViewAndroidDelegate extends ViewAndroidDelegate { |
| private final ViewGroup mContainerView; |
| + private Runnable mOnCursorUpdate; |
| public ShellViewAndroidDelegate(ViewGroup containerView) { |
| mContainerView = containerView; |
| + mOnCursorUpdate = null; |
| } |
| @Override |
| public ViewGroup getContainerView() { |
| return mContainerView; |
| } |
| + |
| + public void setOnCursorUpdate(Runnable callback) { |
| + mOnCursorUpdate = callback; |
| + } |
| + |
| + @Override |
| + public void updatePointerIcon(PointerIcon icon) { |
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| + getContainerView().setPointerIcon(icon); |
| + if (mOnCursorUpdate != null) mOnCursorUpdate.run(); |
|
boliu
2017/05/31 16:30:03
generally, the pattern is this class holds a Callb
jaebaek
2017/06/01 06:20:56
Done.
|
| + } |
| + } |
| } |