| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1918 return for_touch_handle ? OnTouchHandleEvent(event) : OnTouchEvent(event); | 1918 return for_touch_handle ? OnTouchHandleEvent(event) : OnTouchEvent(event); |
| 1919 } | 1919 } |
| 1920 | 1920 |
| 1921 bool RenderWidgetHostViewAndroid::OnMouseEvent( | 1921 bool RenderWidgetHostViewAndroid::OnMouseEvent( |
| 1922 const ui::MotionEventAndroid& event) { | 1922 const ui::MotionEventAndroid& event) { |
| 1923 RecordToolTypeForActionDown(event); | 1923 RecordToolTypeForActionDown(event); |
| 1924 SendMouseEvent(event, event.GetActionButton()); | 1924 SendMouseEvent(event, event.GetActionButton()); |
| 1925 return true; | 1925 return true; |
| 1926 } | 1926 } |
| 1927 | 1927 |
| 1928 bool RenderWidgetHostViewAndroid::OnMouseWheelEvent( |
| 1929 const ui::MotionEventAndroid& event) { |
| 1930 SendMouseWheelEvent(WebMouseWheelEventBuilder::Build( |
| 1931 event.ticks_x(), event.ticks_y(), event.GetTickMultiplier(), |
| 1932 event.time_sec(), event.GetX(0), event.GetY(0))); |
| 1933 return true; |
| 1934 } |
| 1935 |
| 1928 void RenderWidgetHostViewAndroid::OnGestureEvent( | 1936 void RenderWidgetHostViewAndroid::OnGestureEvent( |
| 1929 const ui::GestureEventData& gesture) { | 1937 const ui::GestureEventData& gesture) { |
| 1930 blink::WebGestureEvent web_gesture = | 1938 blink::WebGestureEvent web_gesture = |
| 1931 ui::CreateWebGestureEventFromGestureEventData(gesture); | 1939 ui::CreateWebGestureEventFromGestureEventData(gesture); |
| 1932 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to | 1940 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to |
| 1933 // stop providing shift meta values to synthetic MotionEvents. This prevents | 1941 // stop providing shift meta values to synthetic MotionEvents. This prevents |
| 1934 // unintended shift+click interpretation of all accessibility clicks. | 1942 // unintended shift+click interpretation of all accessibility clicks. |
| 1935 // See crbug.com/443247. | 1943 // See crbug.com/443247. |
| 1936 if (web_gesture.type() == blink::WebInputEvent::GestureTap && | 1944 if (web_gesture.type() == blink::WebInputEvent::GestureTap && |
| 1937 web_gesture.modifiers() == blink::WebInputEvent::ShiftKey) { | 1945 web_gesture.modifiers() == blink::WebInputEvent::ShiftKey) { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2140 | 2148 |
| 2141 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2149 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 2142 if (!compositor) | 2150 if (!compositor) |
| 2143 return; | 2151 return; |
| 2144 | 2152 |
| 2145 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2153 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 2146 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2154 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
| 2147 } | 2155 } |
| 2148 | 2156 |
| 2149 } // namespace content | 2157 } // namespace content |
| OLD | NEW |