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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "content/public/common/content_client.h" | 51 #include "content/public/common/content_client.h" |
52 #include "content/public/common/content_switches.h" | 52 #include "content/public/common/content_switches.h" |
53 #include "content/public/common/menu_item.h" | 53 #include "content/public/common/menu_item.h" |
54 #include "content/public/common/user_agent.h" | 54 #include "content/public/common/user_agent.h" |
55 #include "jni/ContentViewCore_jni.h" | 55 #include "jni/ContentViewCore_jni.h" |
56 #include "jni/DragEvent_jni.h" | 56 #include "jni/DragEvent_jni.h" |
57 #include "third_party/WebKit/public/web/WebInputEvent.h" | 57 #include "third_party/WebKit/public/web/WebInputEvent.h" |
58 #include "ui/android/view_android.h" | 58 #include "ui/android/view_android.h" |
59 #include "ui/android/window_android.h" | 59 #include "ui/android/window_android.h" |
60 #include "ui/base/clipboard/clipboard.h" | 60 #include "ui/base/clipboard/clipboard.h" |
| 61 #include "ui/base/ui_base_switches_util.h" |
61 #include "ui/events/android/motion_event_android.h" | 62 #include "ui/events/android/motion_event_android.h" |
62 #include "ui/events/blink/blink_event_util.h" | 63 #include "ui/events/blink/blink_event_util.h" |
63 #include "ui/events/event_utils.h" | 64 #include "ui/events/event_utils.h" |
64 #include "ui/gfx/android/java_bitmap.h" | 65 #include "ui/gfx/android/java_bitmap.h" |
65 #include "ui/gfx/geometry/point_conversions.h" | 66 #include "ui/gfx/geometry/point_conversions.h" |
66 #include "ui/gfx/geometry/size_conversions.h" | 67 #include "ui/gfx/geometry/size_conversions.h" |
67 #include "ui/gfx/geometry/size_f.h" | 68 #include "ui/gfx/geometry/size_f.h" |
68 | 69 |
69 using base::android::AttachCurrentThread; | 70 using base::android::AttachCurrentThread; |
70 using base::android::ConvertJavaStringToUTF16; | 71 using base::android::ConvertJavaStringToUTF16; |
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 const JavaParamRef<jobject>& jobj, | 1470 const JavaParamRef<jobject>& jobj, |
1470 jboolean opaque) { | 1471 jboolean opaque) { |
1471 if (GetRenderWidgetHostViewAndroid()) { | 1472 if (GetRenderWidgetHostViewAndroid()) { |
1472 if (opaque) | 1473 if (opaque) |
1473 GetRenderWidgetHostViewAndroid()->SetBackgroundColorToDefault(); | 1474 GetRenderWidgetHostViewAndroid()->SetBackgroundColorToDefault(); |
1474 else | 1475 else |
1475 GetRenderWidgetHostViewAndroid()->SetBackgroundColor(SK_ColorTRANSPARENT); | 1476 GetRenderWidgetHostViewAndroid()->SetBackgroundColor(SK_ColorTRANSPARENT); |
1476 } | 1477 } |
1477 } | 1478 } |
1478 | 1479 |
| 1480 bool ContentViewCoreImpl::IsTouchDragDropEnabled( |
| 1481 JNIEnv* env, |
| 1482 const base::android::JavaParamRef<jobject>& jobj) { |
| 1483 return switches::IsTouchDragDropEnabled(); |
| 1484 } |
| 1485 |
1479 void ContentViewCoreImpl::OnDragEvent( | 1486 void ContentViewCoreImpl::OnDragEvent( |
1480 JNIEnv* env, | 1487 JNIEnv* env, |
1481 const base::android::JavaParamRef<jobject>& jobj, | 1488 const base::android::JavaParamRef<jobject>& jobj, |
1482 jint action, | 1489 jint action, |
1483 jint x, | 1490 jint x, |
1484 jint y, | 1491 jint y, |
1485 jint screen_x, | 1492 jint screen_x, |
1486 jint screen_y, | 1493 jint screen_y, |
1487 const base::android::JavaParamRef<jobjectArray>& j_mimeTypes, | 1494 const base::android::JavaParamRef<jobjectArray>& j_mimeTypes, |
1488 const base::android::JavaParamRef<jstring>& j_content) { | 1495 const base::android::JavaParamRef<jstring>& j_content) { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 return ScopedJavaLocalRef<jobject>(); | 1649 return ScopedJavaLocalRef<jobject>(); |
1643 | 1650 |
1644 return view->GetJavaObject(); | 1651 return view->GetJavaObject(); |
1645 } | 1652 } |
1646 | 1653 |
1647 bool RegisterContentViewCore(JNIEnv* env) { | 1654 bool RegisterContentViewCore(JNIEnv* env) { |
1648 return RegisterNativesImpl(env) && JNI_DragEvent::RegisterNativesImpl(env); | 1655 return RegisterNativesImpl(env) && JNI_DragEvent::RegisterNativesImpl(env); |
1649 } | 1656 } |
1650 | 1657 |
1651 } // namespace content | 1658 } // namespace content |
OLD | NEW |