| 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 "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 if (!host_) | 803 if (!host_) |
| 804 return false; | 804 return false; |
| 805 | 805 |
| 806 if (selection_controller_ && | 806 if (selection_controller_ && |
| 807 selection_controller_->WillHandleTouchEvent(event)) | 807 selection_controller_->WillHandleTouchEvent(event)) |
| 808 return true; | 808 return true; |
| 809 | 809 |
| 810 if (stylus_text_selector_.OnTouchEvent(event)) | 810 if (stylus_text_selector_.OnTouchEvent(event)) |
| 811 return true; | 811 return true; |
| 812 | 812 |
| 813 auto result = gesture_provider_.OnTouchEvent(event); | 813 ui::FilteredGestureProvider::TouchHandlingResult result = |
| 814 gesture_provider_.OnTouchEvent(event); |
| 814 if (!result.succeeded) | 815 if (!result.succeeded) |
| 815 return false; | 816 return false; |
| 816 | 817 |
| 817 if (host_->ShouldForwardTouchEvent()) { | 818 blink::WebTouchEvent web_event = |
| 818 blink::WebTouchEvent web_event = | 819 CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); |
| 819 CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); | 820 host_->ForwardTouchEventWithLatencyInfo(web_event, |
| 820 host_->ForwardTouchEventWithLatencyInfo(web_event, | 821 CreateLatencyInfo(web_event)); |
| 821 CreateLatencyInfo(web_event)); | |
| 822 } else { | |
| 823 const bool event_consumed = false; | |
| 824 gesture_provider_.OnAsyncTouchEventAck(event_consumed); | |
| 825 } | |
| 826 | 822 |
| 827 // Send a proactive BeginFrame on the next vsync to reduce latency. | 823 // Send a proactive BeginFrame on the next vsync to reduce latency. |
| 828 // This is good enough as long as the first touch event has Begin semantics | 824 // This is good enough as long as the first touch event has Begin semantics |
| 829 // and the actual scroll happens on the next vsync. | 825 // and the actual scroll happens on the next vsync. |
| 830 if (observing_root_window_) | 826 if (observing_root_window_) |
| 831 RequestVSyncUpdate(BEGIN_FRAME); | 827 RequestVSyncUpdate(BEGIN_FRAME); |
| 832 | 828 |
| 833 return true; | 829 return true; |
| 834 } | 830 } |
| 835 | 831 |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 results->orientationAngle = display.RotationAsDegree(); | 1940 results->orientationAngle = display.RotationAsDegree(); |
| 1945 results->orientationType = | 1941 results->orientationType = |
| 1946 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1942 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1947 gfx::DeviceDisplayInfo info; | 1943 gfx::DeviceDisplayInfo info; |
| 1948 results->depth = info.GetBitsPerPixel(); | 1944 results->depth = info.GetBitsPerPixel(); |
| 1949 results->depthPerComponent = info.GetBitsPerComponent(); | 1945 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1950 results->isMonochrome = (results->depthPerComponent == 0); | 1946 results->isMonochrome = (results->depthPerComponent == 0); |
| 1951 } | 1947 } |
| 1952 | 1948 |
| 1953 } // namespace content | 1949 } // namespace content |
| OLD | NEW |