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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 DCHECK(content_view_core); | 210 DCHECK(content_view_core); |
211 int tap_timeout_ms = gfx::ViewConfiguration::GetTapTimeoutInMs(); | 211 int tap_timeout_ms = gfx::ViewConfiguration::GetTapTimeoutInMs(); |
212 int touch_slop_pixels = gfx::ViewConfiguration::GetTouchSlopInPixels(); | 212 int touch_slop_pixels = gfx::ViewConfiguration::GetTouchSlopInPixels(); |
213 return make_scoped_ptr(new TouchSelectionController( | 213 return make_scoped_ptr(new TouchSelectionController( |
214 client, | 214 client, |
215 base::TimeDelta::FromMilliseconds(tap_timeout_ms), | 215 base::TimeDelta::FromMilliseconds(tap_timeout_ms), |
216 touch_slop_pixels / content_view_core->GetDpiScale())); | 216 touch_slop_pixels / content_view_core->GetDpiScale())); |
217 } | 217 } |
218 | 218 |
219 ui::GestureProvider::Config CreateGestureProviderConfig() { | 219 ui::GestureProvider::Config CreateGestureProviderConfig() { |
220 ui::GestureProvider::Config config = ui::DefaultGestureProviderConfig(); | 220 ui::GestureProvider::Config config = ui::GetGestureProviderConfig( |
221 ui::GestureProviderConfigType::CURRENT_PLATFORM); | |
221 config.disable_click_delay = | 222 config.disable_click_delay = |
222 base::CommandLine::ForCurrentProcess()->HasSwitch( | 223 base::CommandLine::ForCurrentProcess()->HasSwitch( |
223 switches::kDisableClickDelay); | 224 switches::kDisableClickDelay); |
224 return config; | 225 return config; |
225 } | 226 } |
226 | 227 |
227 bool HasFixedPageScale(const cc::CompositorFrameMetadata& frame_metadata) { | 228 bool HasFixedPageScale(const cc::CompositorFrameMetadata& frame_metadata) { |
228 return frame_metadata.min_page_scale_factor == | 229 return frame_metadata.min_page_scale_factor == |
229 frame_metadata.max_page_scale_factor; | 230 frame_metadata.max_page_scale_factor; |
230 } | 231 } |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 if (!host_) | 703 if (!host_) |
703 return false; | 704 return false; |
704 | 705 |
705 if (selection_controller_ && | 706 if (selection_controller_ && |
706 selection_controller_->WillHandleTouchEvent(event)) | 707 selection_controller_->WillHandleTouchEvent(event)) |
707 return true; | 708 return true; |
708 | 709 |
709 if (gesture_text_selector_.OnTouchEvent(event)) | 710 if (gesture_text_selector_.OnTouchEvent(event)) |
710 return true; | 711 return true; |
711 | 712 |
712 if (!gesture_provider_.OnTouchEvent(event)) | 713 auto result = gesture_provider_.OnTouchEvent(event); |
tdresser
2014/10/31 12:34:11
See other comment on auto.
| |
714 if (!result.succeeded) | |
713 return false; | 715 return false; |
714 | 716 |
715 if (host_->ShouldForwardTouchEvent()) { | 717 if (host_->ShouldForwardTouchEvent()) { |
716 blink::WebTouchEvent web_event = CreateWebTouchEventFromMotionEvent(event); | 718 blink::WebTouchEvent web_event = |
719 CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); | |
717 host_->ForwardTouchEventWithLatencyInfo(web_event, | 720 host_->ForwardTouchEventWithLatencyInfo(web_event, |
718 CreateLatencyInfo(web_event)); | 721 CreateLatencyInfo(web_event)); |
719 } else { | 722 } else { |
720 const bool event_consumed = false; | 723 const bool event_consumed = false; |
721 gesture_provider_.OnTouchEventAck(event_consumed); | 724 gesture_provider_.OnTouchEventAck(event_consumed); |
722 } | 725 } |
723 | 726 |
724 // Send a proactive BeginFrame on the next vsync to reduce latency. | 727 // Send a proactive BeginFrame on the next vsync to reduce latency. |
725 // This is good enough as long as the first touch event has Begin semantics | 728 // This is good enough as long as the first touch event has Begin semantics |
726 // and the actual scroll happens on the next vsync. | 729 // and the actual scroll happens on the next vsync. |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1803 results->orientationAngle = display.RotationAsDegree(); | 1806 results->orientationAngle = display.RotationAsDegree(); |
1804 results->orientationType = | 1807 results->orientationType = |
1805 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1808 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1806 gfx::DeviceDisplayInfo info; | 1809 gfx::DeviceDisplayInfo info; |
1807 results->depth = info.GetBitsPerPixel(); | 1810 results->depth = info.GetBitsPerPixel(); |
1808 results->depthPerComponent = info.GetBitsPerComponent(); | 1811 results->depthPerComponent = info.GetBitsPerComponent(); |
1809 results->isMonochrome = (results->depthPerComponent == 0); | 1812 results->isMonochrome = (results->depthPerComponent == 0); |
1810 } | 1813 } |
1811 | 1814 |
1812 } // namespace content | 1815 } // namespace content |
OLD | NEW |