| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "jni/ContentViewCore_jni.h" | 55 #include "jni/ContentViewCore_jni.h" |
| 56 #include "third_party/WebKit/public/web/WebBindings.h" | 56 #include "third_party/WebKit/public/web/WebBindings.h" |
| 57 #include "third_party/WebKit/public/web/WebInputEvent.h" | 57 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 58 #include "ui/base/android/view_android.h" | 58 #include "ui/base/android/view_android.h" |
| 59 #include "ui/base/android/window_android.h" | 59 #include "ui/base/android/window_android.h" |
| 60 #include "ui/gfx/android/java_bitmap.h" | 60 #include "ui/gfx/android/java_bitmap.h" |
| 61 #include "ui/gfx/screen.h" | 61 #include "ui/gfx/screen.h" |
| 62 #include "ui/gfx/size_conversions.h" | 62 #include "ui/gfx/size_conversions.h" |
| 63 #include "ui/gfx/size_f.h" | 63 #include "ui/gfx/size_f.h" |
| 64 | 64 |
| 65 #include <android/log.h> |
| 66 |
| 65 using base::android::AttachCurrentThread; | 67 using base::android::AttachCurrentThread; |
| 66 using base::android::ConvertJavaStringToUTF16; | 68 using base::android::ConvertJavaStringToUTF16; |
| 67 using base::android::ConvertJavaStringToUTF8; | 69 using base::android::ConvertJavaStringToUTF8; |
| 68 using base::android::ConvertUTF16ToJavaString; | 70 using base::android::ConvertUTF16ToJavaString; |
| 69 using base::android::ConvertUTF8ToJavaString; | 71 using base::android::ConvertUTF8ToJavaString; |
| 70 using base::android::ScopedJavaGlobalRef; | 72 using base::android::ScopedJavaGlobalRef; |
| 71 using base::android::ScopedJavaLocalRef; | 73 using base::android::ScopedJavaLocalRef; |
| 72 using blink::WebGestureEvent; | 74 using blink::WebGestureEvent; |
| 73 using blink::WebInputEvent; | 75 using blink::WebInputEvent; |
| 74 | 76 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 case WebInputEvent::GestureScrollEnd: | 586 case WebInputEvent::GestureScrollEnd: |
| 585 Java_ContentViewCore_onScrollEndEventAck(env, j_obj.obj()); | 587 Java_ContentViewCore_onScrollEndEventAck(env, j_obj.obj()); |
| 586 break; | 588 break; |
| 587 case WebInputEvent::GesturePinchBegin: | 589 case WebInputEvent::GesturePinchBegin: |
| 588 Java_ContentViewCore_onPinchBeginEventAck(env, j_obj.obj()); | 590 Java_ContentViewCore_onPinchBeginEventAck(env, j_obj.obj()); |
| 589 break; | 591 break; |
| 590 case WebInputEvent::GesturePinchEnd: | 592 case WebInputEvent::GesturePinchEnd: |
| 591 Java_ContentViewCore_onPinchEndEventAck(env, j_obj.obj()); | 593 Java_ContentViewCore_onPinchEndEventAck(env, j_obj.obj()); |
| 592 break; | 594 break; |
| 593 case WebInputEvent::GestureTap: | 595 case WebInputEvent::GestureTap: |
| 594 if (ack_result != INPUT_EVENT_ACK_STATE_CONSUMED) { | 596 /* if (ack_result != INPUT_EVENT_ACK_STATE_CONSUMED)*/ { |
| 595 Java_ContentViewCore_onTapEventNotConsumed( | 597 Java_ContentViewCore_onTapEventNotConsumed( |
| 596 env, j_obj.obj(), event.x * dpi_scale(), event.y * dpi_scale()); | 598 env, j_obj.obj(), event.x * dpi_scale(), event.y * dpi_scale()); |
| 599 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
| 600 web_contents_->GetRenderViewHost()); |
| 601 rvhi->SelectForSearch(); |
| 597 } | 602 } |
| 598 break; | 603 break; |
| 599 case WebInputEvent::GestureDoubleTap: | 604 case WebInputEvent::GestureDoubleTap: |
| 600 Java_ContentViewCore_onDoubleTapEventAck(env, j_obj.obj()); | 605 Java_ContentViewCore_onDoubleTapEventAck(env, j_obj.obj()); |
| 601 break; | 606 break; |
| 602 default: | 607 default: |
| 603 break; | 608 break; |
| 604 } | 609 } |
| 605 } | 610 } |
| 606 | 611 |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1674 reinterpret_cast<ui::ViewAndroid*>(view_android), |
| 1670 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1675 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
| 1671 return reinterpret_cast<intptr_t>(view); | 1676 return reinterpret_cast<intptr_t>(view); |
| 1672 } | 1677 } |
| 1673 | 1678 |
| 1674 bool RegisterContentViewCore(JNIEnv* env) { | 1679 bool RegisterContentViewCore(JNIEnv* env) { |
| 1675 return RegisterNativesImpl(env); | 1680 return RegisterNativesImpl(env); |
| 1676 } | 1681 } |
| 1677 | 1682 |
| 1678 } // namespace content | 1683 } // namespace content |
| OLD | NEW |