Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 1417173008: Move MotionEventAndroid to ui/events/android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copyright date fix. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "cc/layers/layer.h" 16 #include "cc/layers/layer.h"
17 #include "cc/layers/solid_color_layer.h" 17 #include "cc/layers/solid_color_layer.h"
18 #include "cc/output/begin_frame_args.h" 18 #include "cc/output/begin_frame_args.h"
19 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 19 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
20 #include "content/browser/android/gesture_event_type.h" 20 #include "content/browser/android/gesture_event_type.h"
21 #include "content/browser/android/interstitial_page_delegate_android.h" 21 #include "content/browser/android/interstitial_page_delegate_android.h"
22 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" 22 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h"
23 #include "content/browser/android/load_url_params.h" 23 #include "content/browser/android/load_url_params.h"
24 #include "content/browser/frame_host/interstitial_page_impl.h" 24 #include "content/browser/frame_host/interstitial_page_impl.h"
25 #include "content/browser/geolocation/geolocation_service_context.h" 25 #include "content/browser/geolocation/geolocation_service_context.h"
26 #include "content/browser/media/media_web_contents_observer.h" 26 #include "content/browser/media/media_web_contents_observer.h"
27 #include "content/browser/renderer_host/compositor_impl_android.h" 27 #include "content/browser/renderer_host/compositor_impl_android.h"
28 #include "content/browser/renderer_host/input/motion_event_android.h"
29 #include "content/browser/renderer_host/input/web_input_event_builders_android.h " 28 #include "content/browser/renderer_host/input/web_input_event_builders_android.h "
30 #include "content/browser/renderer_host/input/web_input_event_util.h" 29 #include "content/browser/renderer_host/input/web_input_event_util.h"
31 #include "content/browser/renderer_host/render_view_host_impl.h" 30 #include "content/browser/renderer_host/render_view_host_impl.h"
32 #include "content/browser/renderer_host/render_widget_host_impl.h" 31 #include "content/browser/renderer_host/render_widget_host_impl.h"
33 #include "content/browser/renderer_host/render_widget_host_view_android.h" 32 #include "content/browser/renderer_host/render_widget_host_view_android.h"
34 #include "content/browser/web_contents/web_contents_view_android.h" 33 #include "content/browser/web_contents/web_contents_view_android.h"
35 #include "content/common/frame_messages.h" 34 #include "content/common/frame_messages.h"
36 #include "content/common/input/web_input_event_traits.h" 35 #include "content/common/input/web_input_event_traits.h"
37 #include "content/common/input_messages.h" 36 #include "content/common/input_messages.h"
38 #include "content/common/view_messages.h" 37 #include "content/common/view_messages.h"
39 #include "content/public/browser/android/compositor.h" 38 #include "content/public/browser/android/compositor.h"
40 #include "content/public/browser/browser_context.h" 39 #include "content/public/browser/browser_context.h"
41 #include "content/public/browser/browser_thread.h" 40 #include "content/public/browser/browser_thread.h"
42 #include "content/public/browser/favicon_status.h" 41 #include "content/public/browser/favicon_status.h"
43 #include "content/public/browser/render_frame_host.h" 42 #include "content/public/browser/render_frame_host.h"
44 #include "content/public/browser/screen_orientation_dispatcher_host.h" 43 #include "content/public/browser/screen_orientation_dispatcher_host.h"
45 #include "content/public/browser/ssl_host_state_delegate.h" 44 #include "content/public/browser/ssl_host_state_delegate.h"
46 #include "content/public/browser/web_contents.h" 45 #include "content/public/browser/web_contents.h"
47 #include "content/public/common/content_client.h" 46 #include "content/public/common/content_client.h"
48 #include "content/public/common/content_switches.h" 47 #include "content/public/common/content_switches.h"
49 #include "content/public/common/menu_item.h" 48 #include "content/public/common/menu_item.h"
50 #include "content/public/common/user_agent.h" 49 #include "content/public/common/user_agent.h"
51 #include "jni/ContentViewCore_jni.h" 50 #include "jni/ContentViewCore_jni.h"
52 #include "third_party/WebKit/public/web/WebInputEvent.h" 51 #include "third_party/WebKit/public/web/WebInputEvent.h"
53 #include "ui/android/view_android.h" 52 #include "ui/android/view_android.h"
54 #include "ui/android/window_android.h" 53 #include "ui/android/window_android.h"
54 #include "ui/events/android/motion_event_android.h"
55 #include "ui/gfx/android/java_bitmap.h" 55 #include "ui/gfx/android/java_bitmap.h"
56 #include "ui/gfx/geometry/point_conversions.h" 56 #include "ui/gfx/geometry/point_conversions.h"
57 #include "ui/gfx/geometry/size_conversions.h" 57 #include "ui/gfx/geometry/size_conversions.h"
58 #include "ui/gfx/geometry/size_f.h" 58 #include "ui/gfx/geometry/size_f.h"
59 59
60 using base::android::AttachCurrentThread; 60 using base::android::AttachCurrentThread;
61 using base::android::ConvertJavaStringToUTF16; 61 using base::android::ConvertJavaStringToUTF16;
62 using base::android::ConvertJavaStringToUTF8; 62 using base::android::ConvertJavaStringToUTF8;
63 using base::android::ConvertUTF16ToJavaString; 63 using base::android::ConvertUTF16ToJavaString;
64 using base::android::ConvertUTF8ToJavaString; 64 using base::android::ConvertUTF8ToJavaString;
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 jint android_tool_type_0, 886 jint android_tool_type_0,
887 jint android_tool_type_1, 887 jint android_tool_type_1,
888 jint android_button_state, 888 jint android_button_state,
889 jint android_meta_state, 889 jint android_meta_state,
890 jboolean is_touch_handle_event) { 890 jboolean is_touch_handle_event) {
891 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); 891 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
892 // Avoid synthesizing a touch event if it cannot be forwarded. 892 // Avoid synthesizing a touch event if it cannot be forwarded.
893 if (!rwhv) 893 if (!rwhv)
894 return false; 894 return false;
895 895
896 MotionEventAndroid::Pointer pointer0(pointer_id_0, 896 ui::MotionEventAndroid::Pointer pointer0(pointer_id_0,
897 pos_x_0, 897 pos_x_0,
898 pos_y_0, 898 pos_y_0,
899 touch_major_0, 899 touch_major_0,
900 touch_minor_0, 900 touch_minor_0,
901 orientation_0, 901 orientation_0,
902 tilt_0, 902 tilt_0,
903 android_tool_type_0); 903 android_tool_type_0);
904 MotionEventAndroid::Pointer pointer1(pointer_id_1, 904 ui::MotionEventAndroid::Pointer pointer1(pointer_id_1,
905 pos_x_1, 905 pos_x_1,
906 pos_y_1, 906 pos_y_1,
907 touch_major_1, 907 touch_major_1,
908 touch_minor_1, 908 touch_minor_1,
909 orientation_1, 909 orientation_1,
910 tilt_1, 910 tilt_1,
911 android_tool_type_1); 911 android_tool_type_1);
912 MotionEventAndroid event(1.f / dpi_scale(), 912 ui::MotionEventAndroid event(1.f / dpi_scale(),
913 env, 913 env,
914 motion_event, 914 motion_event,
915 time_ms, 915 time_ms,
916 android_action, 916 android_action,
917 pointer_count, 917 pointer_count,
918 history_size, 918 history_size,
919 action_index, 919 action_index,
920 android_button_state, 920 android_button_state,
921 android_meta_state, 921 android_meta_state,
922 raw_pos_x - pos_x_0, 922 raw_pos_x - pos_x_0,
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 return ScopedJavaLocalRef<jobject>(); 1454 return ScopedJavaLocalRef<jobject>();
1455 1455
1456 return view->GetJavaObject(); 1456 return view->GetJavaObject();
1457 } 1457 }
1458 1458
1459 bool RegisterContentViewCore(JNIEnv* env) { 1459 bool RegisterContentViewCore(JNIEnv* env) {
1460 return RegisterNativesImpl(env); 1460 return RegisterNativesImpl(env);
1461 } 1461 }
1462 1462
1463 } // namespace content 1463 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/browser_jni_registrar.cc ('k') | content/browser/renderer_host/input/motion_event_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698