| 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 if (!host_) | 698 if (!host_) |
| 699 return false; | 699 return false; |
| 700 | 700 |
| 701 if (selection_controller_ && | 701 if (selection_controller_ && |
| 702 selection_controller_->WillHandleTouchEvent(event)) | 702 selection_controller_->WillHandleTouchEvent(event)) |
| 703 return true; | 703 return true; |
| 704 | 704 |
| 705 if (gesture_text_selector_.OnTouchEvent(event)) | 705 if (gesture_text_selector_.OnTouchEvent(event)) |
| 706 return true; | 706 return true; |
| 707 | 707 |
| 708 if (!gesture_provider_.OnTouchEvent(event)) | 708 auto result = gesture_provider_.OnTouchEvent(event); |
| 709 if (!result.succeeded) |
| 709 return false; | 710 return false; |
| 710 | 711 |
| 711 if (host_->ShouldForwardTouchEvent()) { | 712 if (host_->ShouldForwardTouchEvent()) { |
| 712 blink::WebTouchEvent web_event = CreateWebTouchEventFromMotionEvent(event); | 713 blink::WebTouchEvent web_event = |
| 714 CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); |
| 713 host_->ForwardTouchEventWithLatencyInfo(web_event, | 715 host_->ForwardTouchEventWithLatencyInfo(web_event, |
| 714 CreateLatencyInfo(web_event)); | 716 CreateLatencyInfo(web_event)); |
| 715 } else { | 717 } else { |
| 716 const bool event_consumed = false; | 718 const bool event_consumed = false; |
| 717 gesture_provider_.OnTouchEventAck(event_consumed); | 719 gesture_provider_.OnTouchEventAck(event_consumed); |
| 718 } | 720 } |
| 719 | 721 |
| 720 // Send a proactive BeginFrame on the next vsync to reduce latency. | 722 // Send a proactive BeginFrame on the next vsync to reduce latency. |
| 721 // This is good enough as long as the first touch event has Begin semantics | 723 // This is good enough as long as the first touch event has Begin semantics |
| 722 // and the actual scroll happens on the next vsync. | 724 // and the actual scroll happens on the next vsync. |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1808 results->orientationAngle = display.RotationAsDegree(); | 1810 results->orientationAngle = display.RotationAsDegree(); |
| 1809 results->orientationType = | 1811 results->orientationType = |
| 1810 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1812 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1811 gfx::DeviceDisplayInfo info; | 1813 gfx::DeviceDisplayInfo info; |
| 1812 results->depth = info.GetBitsPerPixel(); | 1814 results->depth = info.GetBitsPerPixel(); |
| 1813 results->depthPerComponent = info.GetBitsPerComponent(); | 1815 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1814 results->isMonochrome = (results->depthPerComponent == 0); | 1816 results->isMonochrome = (results->depthPerComponent == 0); |
| 1815 } | 1817 } |
| 1816 | 1818 |
| 1817 } // namespace content | 1819 } // namespace content |
| OLD | NEW |