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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 DCHECK(window); | 277 DCHECK(window); |
278 ui::WindowAndroidCompositor* compositor = window->GetCompositor(); | 278 ui::WindowAndroidCompositor* compositor = window->GetCompositor(); |
279 DCHECK(compositor); | 279 DCHECK(compositor); |
280 return make_scoped_ptr(new OverscrollControllerAndroid( | 280 return make_scoped_ptr(new OverscrollControllerAndroid( |
281 content_view_core->GetWebContents(), | 281 content_view_core->GetWebContents(), |
282 compositor, | 282 compositor, |
283 content_view_core->GetDpiScale())); | 283 content_view_core->GetDpiScale())); |
284 } | 284 } |
285 | 285 |
286 ui::GestureProvider::Config CreateGestureProviderConfig() { | 286 ui::GestureProvider::Config CreateGestureProviderConfig() { |
287 ui::GestureProvider::Config config = ui::DefaultGestureProviderConfig(); | 287 ui::GestureProvider::Config config = ui::GetGestureProviderConfig( |
| 288 ui::GestureProviderConfigType::CURRENT_PLATFORM); |
288 config.disable_click_delay = | 289 config.disable_click_delay = |
289 base::CommandLine::ForCurrentProcess()->HasSwitch( | 290 base::CommandLine::ForCurrentProcess()->HasSwitch( |
290 switches::kDisableClickDelay); | 291 switches::kDisableClickDelay); |
291 return config; | 292 return config; |
292 } | 293 } |
293 | 294 |
294 bool HasFixedPageScale(const cc::CompositorFrameMetadata& frame_metadata) { | 295 bool HasFixedPageScale(const cc::CompositorFrameMetadata& frame_metadata) { |
295 return frame_metadata.min_page_scale_factor == | 296 return frame_metadata.min_page_scale_factor == |
296 frame_metadata.max_page_scale_factor; | 297 frame_metadata.max_page_scale_factor; |
297 } | 298 } |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 if (!host_) | 784 if (!host_) |
784 return false; | 785 return false; |
785 | 786 |
786 if (selection_controller_ && | 787 if (selection_controller_ && |
787 selection_controller_->WillHandleTouchEvent(event)) | 788 selection_controller_->WillHandleTouchEvent(event)) |
788 return true; | 789 return true; |
789 | 790 |
790 if (stylus_text_selector_.OnTouchEvent(event)) | 791 if (stylus_text_selector_.OnTouchEvent(event)) |
791 return true; | 792 return true; |
792 | 793 |
793 if (!gesture_provider_.OnTouchEvent(event)) | 794 auto result = gesture_provider_.OnTouchEvent(event); |
| 795 if (!result.succeeded) |
794 return false; | 796 return false; |
795 | 797 |
796 if (host_->ShouldForwardTouchEvent()) { | 798 if (host_->ShouldForwardTouchEvent()) { |
797 blink::WebTouchEvent web_event = CreateWebTouchEventFromMotionEvent(event); | 799 blink::WebTouchEvent web_event = |
| 800 CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); |
798 host_->ForwardTouchEventWithLatencyInfo(web_event, | 801 host_->ForwardTouchEventWithLatencyInfo(web_event, |
799 CreateLatencyInfo(web_event)); | 802 CreateLatencyInfo(web_event)); |
800 } else { | 803 } else { |
801 const bool event_consumed = false; | 804 const bool event_consumed = false; |
802 gesture_provider_.OnAsyncTouchEventAck(event_consumed); | 805 gesture_provider_.OnAsyncTouchEventAck(event_consumed); |
803 } | 806 } |
804 | 807 |
805 // Send a proactive BeginFrame on the next vsync to reduce latency. | 808 // Send a proactive BeginFrame on the next vsync to reduce latency. |
806 // This is good enough as long as the first touch event has Begin semantics | 809 // This is good enough as long as the first touch event has Begin semantics |
807 // and the actual scroll happens on the next vsync. | 810 // and the actual scroll happens on the next vsync. |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 results->orientationAngle = display.RotationAsDegree(); | 1901 results->orientationAngle = display.RotationAsDegree(); |
1899 results->orientationType = | 1902 results->orientationType = |
1900 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1903 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1901 gfx::DeviceDisplayInfo info; | 1904 gfx::DeviceDisplayInfo info; |
1902 results->depth = info.GetBitsPerPixel(); | 1905 results->depth = info.GetBitsPerPixel(); |
1903 results->depthPerComponent = info.GetBitsPerComponent(); | 1906 results->depthPerComponent = info.GetBitsPerComponent(); |
1904 results->isMonochrome = (results->depthPerComponent == 0); | 1907 results->isMonochrome = (results->depthPerComponent == 0); |
1905 } | 1908 } |
1906 | 1909 |
1907 } // namespace content | 1910 } // namespace content |
OLD | NEW |