Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_android.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
| index f6f9f43b7c8910076d73e795fe8b21fa9948b855..9a24bc7176f5c36a9e43f262818d7f5b5c1d27e6 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -662,10 +662,9 @@ gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { |
| if (!content_view_core_) { |
| if (default_bounds_.IsEmpty()) return gfx::Size(); |
| - return gfx::Size(default_bounds_.right() |
| - * ui::GetScaleFactorForNativeView(GetNativeView()), |
|
boliu
2017/03/13 01:51:57
all other platforms are switching to GetScaleFacto
Jinsuk Kim
2017/03/13 01:58:21
ViewAndroid::GetDipScale() calls exactly that. I b
|
| - default_bounds_.bottom() |
| - * ui::GetScaleFactorForNativeView(GetNativeView())); |
| + float scale_factor = view_.GetDipScale(); |
| + return gfx::Size(default_bounds_.right() * scale_factor, |
| + default_bounds_.bottom() * scale_factor); |
| } |
| return content_view_core_->GetPhysicalBackingSize(); |
| @@ -1299,8 +1298,7 @@ RenderWidgetHostViewAndroid::CreateDrawable() { |
| content_view_core_->GetContext(); |
| return std::unique_ptr<ui::TouchHandleDrawable>( |
| new CompositedTouchHandleDrawable( |
| - content_view_core_->GetViewAndroid()->GetLayer(), |
| - ui::GetScaleFactorForNativeView(GetNativeView()), |
| + content_view_core_->GetViewAndroid()->GetLayer(), view_.GetDipScale(), |
| // Use the activity context where possible (instead of the application |
| // context) to ensure proper handle theming. |
| activityContext.is_null() ? base::android::GetApplicationContext() |
| @@ -1375,7 +1373,7 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated( |
| frame_metadata.top_controls_height * |
| frame_metadata.top_controls_shown_ratio)); |
| - float dip_scale = ui::GetScaleFactorForNativeView(GetNativeView()); |
| + float dip_scale = view_.GetDipScale(); |
| float top_controls_pix = frame_metadata.top_controls_height * dip_scale; |
| float top_shown_pix = |
| top_controls_pix * frame_metadata.top_controls_shown_ratio; |
| @@ -2134,8 +2132,7 @@ void RenderWidgetHostViewAndroid::CreateOverscrollControllerIfPossible() { |
| return; |
| overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
| - overscroll_refresh_handler, compositor, |
| - ui::GetScaleFactorForNativeView(GetNativeView())); |
| + overscroll_refresh_handler, compositor, view_.GetDipScale()); |
| } |
| } // namespace content |