| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 if (stylus_text_selector_.OnTouchEvent(event)) { | 731 if (stylus_text_selector_.OnTouchEvent(event)) { |
| 732 RequestDisallowInterceptTouchEvent(); | 732 RequestDisallowInterceptTouchEvent(); |
| 733 return true; | 733 return true; |
| 734 } | 734 } |
| 735 | 735 |
| 736 ui::FilteredGestureProvider::TouchHandlingResult result = | 736 ui::FilteredGestureProvider::TouchHandlingResult result = |
| 737 gesture_provider_.OnTouchEvent(event); | 737 gesture_provider_.OnTouchEvent(event); |
| 738 if (!result.succeeded) | 738 if (!result.succeeded) |
| 739 return false; | 739 return false; |
| 740 | 740 |
| 741 blink::WebTouchEvent web_event = | 741 blink::WebTouchEvent web_event = ui::CreateWebTouchEventFromMotionEvent( |
| 742 ui::CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); | 742 event, result.moved_beyond_slop_region); |
| 743 host_->ForwardTouchEventWithLatencyInfo(web_event, ui::LatencyInfo()); | 743 host_->ForwardTouchEventWithLatencyInfo(web_event, ui::LatencyInfo()); |
| 744 | 744 |
| 745 // Send a proactive BeginFrame for this vsync to reduce scroll latency for | 745 // Send a proactive BeginFrame for this vsync to reduce scroll latency for |
| 746 // scroll-inducing touch events. Note that Android's Choreographer ensures | 746 // scroll-inducing touch events. Note that Android's Choreographer ensures |
| 747 // that BeginFrame requests made during ACTION_MOVE dispatch will be honored | 747 // that BeginFrame requests made during ACTION_MOVE dispatch will be honored |
| 748 // in the same vsync phase. | 748 // in the same vsync phase. |
| 749 if (observing_root_window_ && result.did_generate_scroll) | 749 if (observing_root_window_ && result.moved_beyond_slop_region) |
| 750 RequestVSyncUpdate(BEGIN_FRAME); | 750 RequestVSyncUpdate(BEGIN_FRAME); |
| 751 | 751 |
| 752 return true; | 752 return true; |
| 753 } | 753 } |
| 754 | 754 |
| 755 bool RenderWidgetHostViewAndroid::OnTouchHandleEvent( | 755 bool RenderWidgetHostViewAndroid::OnTouchHandleEvent( |
| 756 const ui::MotionEvent& event) { | 756 const ui::MotionEvent& event) { |
| 757 return selection_controller_ && | 757 return selection_controller_ && |
| 758 selection_controller_->WillHandleTouchEvent(event); | 758 selection_controller_->WillHandleTouchEvent(event); |
| 759 } | 759 } |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2063 results->orientationAngle = display.RotationAsDegree(); | 2063 results->orientationAngle = display.RotationAsDegree(); |
| 2064 results->orientationType = | 2064 results->orientationType = |
| 2065 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2065 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2066 gfx::DeviceDisplayInfo info; | 2066 gfx::DeviceDisplayInfo info; |
| 2067 results->depth = info.GetBitsPerPixel(); | 2067 results->depth = info.GetBitsPerPixel(); |
| 2068 results->depthPerComponent = info.GetBitsPerComponent(); | 2068 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2069 results->isMonochrome = (results->depthPerComponent == 0); | 2069 results->isMonochrome = (results->depthPerComponent == 0); |
| 2070 } | 2070 } |
| 2071 | 2071 |
| 2072 } // namespace content | 2072 } // namespace content |
| OLD | NEW |