Index: chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java |
index 427864988075910a70c08ea24f027359b74a4dab..bdbec527b24b2f30f3950532037716a1059dc248 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java |
@@ -4,6 +4,7 @@ |
package org.chromium.chrome.browser.prerender; |
+import android.app.Application; |
import android.content.Context; |
import android.content.res.Resources; |
import android.graphics.Point; |
@@ -120,20 +121,20 @@ |
* The estimate is likely to be incorrect. This is not a problem, as the aim |
* is to avoid getting a different layout and resources than needed at |
* render time. |
- * @param context The application context. |
+ * @param application The application to use for getting resources. |
* @param convertToDp Whether the value should be converted to dp from pixels. |
* @return The estimated prerender size in pixels or dp. |
*/ |
- public static Rect estimateContentSize(Context context, boolean convertToDp) { |
+ public static Rect estimateContentSize(Application application, boolean convertToDp) { |
// The size is estimated as: |
// X = screenSizeX |
// Y = screenSizeY - top bar - bottom bar - custom tabs bar |
// 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); |
+ WindowManager wm = (WindowManager) application.getSystemService(Context.WINDOW_SERVICE); |
wm.getDefaultDisplay().getSize(screenSize); |
- Resources resources = context.getResources(); |
+ Resources resources = application.getResources(); |
int statusBarId = resources.getIdentifier("status_bar_height", "dimen", "android"); |
try { |
screenSize.y -= resources.getDimensionPixelSize(statusBarId); |