Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java

Issue 1348473002: Fix size estimation for prerender in custom tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed cached size and cvc resize Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
index 4b2d4ebcd10e8ed9cec8b173399ca6dd9f7582a1..a3cd9d92308fd0a280050a98af7381d9ce560f98 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -703,15 +703,16 @@ public class CustomTabsConnection extends ICustomTabsService.Stub {
wm.getDefaultDisplay().getSize(screenSize);
Resources resources = mApplication.getResources();
int statusBarId = resources.getIdentifier("status_bar_height", "dimen", "android");
- int navigationBarId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
try {
screenSize.y -=
resources.getDimensionPixelSize(R.dimen.custom_tabs_control_container_height);
screenSize.y -= resources.getDimensionPixelSize(statusBarId);
- screenSize.y -= resources.getDimensionPixelSize(navigationBarId);
} catch (Resources.NotFoundException e) {
// Nothing, this is just a best effort estimate.
}
+ float density = resources.getDisplayMetrics().density;
+ screenSize.x /= density;
+ screenSize.y /= density;
return screenSize;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698