Commit bd711be6 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

android: Use DisplayAndroid in prerender

Bug: 1042063
Change-Id: Iae03f34cd256bce803bd4c7e215ea3f56def168b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2016852Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737356}
parent 7220e47a
......@@ -9,7 +9,7 @@ import android.content.res.Resources;
import android.graphics.Point;
import android.graphics.Rect;
import android.util.Pair;
import android.view.WindowManager;
import android.view.Display;
import androidx.annotation.VisibleForTesting;
......@@ -19,6 +19,7 @@ import org.chromium.chrome.R;
import org.chromium.chrome.browser.WebContentsFactory;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.display.DisplayAndroidManager;
/**
* A handler class for prerender requests coming from other applications.
......@@ -119,8 +120,8 @@ public class ExternalPrerenderHandler {
// The bounds rectangle includes the bottom bar and the custom tabs bar as well.
Rect screenBounds = new Rect();
Point screenSize = new Point();
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
wm.getDefaultDisplay().getSize(screenSize);
Display display = DisplayAndroidManager.getDefaultDisplayForContext(context);
display.getSize(screenSize);
Resources resources = context.getResources();
int statusBarId = resources.getIdentifier("status_bar_height", "dimen", "android");
try {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment