Chromium Code Reviews| Index: ui/android/view_android.cc |
| diff --git a/ui/android/view_android.cc b/ui/android/view_android.cc |
| index 15e51a0042ca48b6eb5c29d0bbbc6cafdb9541a3..65b493259f9957fcd85f678d927b41c12d73a242 100644 |
| --- a/ui/android/view_android.cc |
| +++ b/ui/android/view_android.cc |
| @@ -11,11 +11,13 @@ |
| #include "base/containers/adapters.h" |
| #include "cc/layers/layer.h" |
| #include "jni/ViewAndroidDelegate_jni.h" |
| +#include "ui/android/cursor_type.h" |
|
Jinsuk Kim
2017/05/17 04:49:50
It's already included in the header. No need to in
jaebaek
2017/05/18 01:44:29
Done.
|
| #include "ui/android/event_forwarder.h" |
| #include "ui/android/view_client.h" |
| #include "ui/android/window_android.h" |
| #include "ui/base/layout.h" |
| #include "ui/events/android/motion_event_android.h" |
| +#include "ui/gfx/android/java_bitmap.h" |
| #include "url/gurl.h" |
| namespace ui { |
| @@ -243,6 +245,25 @@ bool ViewAndroid::StartDragAndDrop(const JavaRef<jstring>& jtext, |
| jimage); |
| } |
| +void ViewAndroid::OnCursorChanged(CursorType type, |
| + const SkBitmap& custom_image, |
| + const gfx::Point& hotspot) { |
| + ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); |
| + if (delegate.is_null()) |
| + return; |
| + JNIEnv* env = base::android::AttachCurrentThread(); |
| + if (type == CURSOR_TYPE_CUSTOM) { |
| + ScopedJavaLocalRef<jobject> java_bitmap = |
| + gfx::ConvertToJavaBitmap(&custom_image); |
| + Java_ViewAndroidDelegate_onCursorChangedToCustom( |
| + env, delegate, java_bitmap, static_cast<jint>(hotspot.x()), |
|
Jinsuk Kim
2017/05/17 04:49:50
I think you can do without static_cast.
jaebaek
2017/05/18 01:44:29
Done.
|
| + static_cast<jint>(hotspot.y())); |
| + } else { |
| + Java_ViewAndroidDelegate_onCursorChanged(env, delegate, |
| + static_cast<jint>(type)); |
| + } |
| +} |
| + |
| void ViewAndroid::OnBackgroundColorChanged(unsigned int color) { |
| ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); |
| if (delegate.is_null()) |