| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 | 669 |
| 670 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { | 670 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { |
| 671 if (!content_view_core_) { | 671 if (!content_view_core_) { |
| 672 if (default_bounds_.IsEmpty()) return gfx::Size(); | 672 if (default_bounds_.IsEmpty()) return gfx::Size(); |
| 673 | 673 |
| 674 float scale_factor = view_.GetDipScale(); | 674 float scale_factor = view_.GetDipScale(); |
| 675 return gfx::Size(default_bounds_.right() * scale_factor, | 675 return gfx::Size(default_bounds_.right() * scale_factor, |
| 676 default_bounds_.bottom() * scale_factor); | 676 default_bounds_.bottom() * scale_factor); |
| 677 } | 677 } |
| 678 | 678 |
| 679 return content_view_core_->GetPhysicalBackingSize(); | 679 return view_.GetPhysicalBackingSize(); |
| 680 } | 680 } |
| 681 | 681 |
| 682 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { | 682 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { |
| 683 // Whether or not Blink's viewport size should be shrunk by the height of the | 683 // Whether or not Blink's viewport size should be shrunk by the height of the |
| 684 // URL-bar. | 684 // URL-bar. |
| 685 return content_view_core_ && | 685 return content_view_core_ && |
| 686 content_view_core_->DoBrowserControlsShrinkBlinkSize(); | 686 content_view_core_->DoBrowserControlsShrinkBlinkSize(); |
| 687 } | 687 } |
| 688 | 688 |
| 689 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { | 689 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 if (gesture_provider_.OnTouchEvent(*cancel_event).succeeded) { | 983 if (gesture_provider_.OnTouchEvent(*cancel_event).succeeded) { |
| 984 bool causes_scrolling = false; | 984 bool causes_scrolling = false; |
| 985 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH); | 985 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH); |
| 986 latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); | 986 latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); |
| 987 host_->ForwardTouchEventWithLatencyInfo( | 987 host_->ForwardTouchEventWithLatencyInfo( |
| 988 ui::CreateWebTouchEventFromMotionEvent(*cancel_event, causes_scrolling), | 988 ui::CreateWebTouchEventFromMotionEvent(*cancel_event, causes_scrolling), |
| 989 latency_info); | 989 latency_info); |
| 990 } | 990 } |
| 991 } | 991 } |
| 992 | 992 |
| 993 bool RenderWidgetHostViewAndroid::OnPhysicalBackingSizeChanged() { |
| 994 host_->WasResized(); |
| 995 return true; |
| 996 } |
| 997 |
| 993 void RenderWidgetHostViewAndroid::OnDidNavigateMainFrameToNewPage() { | 998 void RenderWidgetHostViewAndroid::OnDidNavigateMainFrameToNewPage() { |
| 994 ResetGestureDetection(); | 999 ResetGestureDetection(); |
| 995 } | 1000 } |
| 996 | 1001 |
| 997 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { | 1002 void RenderWidgetHostViewAndroid::SetDoubleTapSupportEnabled(bool enabled) { |
| 998 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); | 1003 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); |
| 999 } | 1004 } |
| 1000 | 1005 |
| 1001 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( | 1006 void RenderWidgetHostViewAndroid::SetMultiTouchZoomSupportEnabled( |
| 1002 bool enabled) { | 1007 bool enabled) { |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2190 | 2195 |
| 2191 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2196 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
| 2192 if (!compositor) | 2197 if (!compositor) |
| 2193 return; | 2198 return; |
| 2194 | 2199 |
| 2195 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2200 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| 2196 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2201 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
| 2197 } | 2202 } |
| 2198 | 2203 |
| 2199 } // namespace content | 2204 } // namespace content |
| OLD | NEW |