diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-03-16 16:20:15 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-03-16 16:52:20 -0400 |
commit | d222a16286c65ce1846b8d3b695eb481c94d2724 (patch) | |
tree | 27c87cc2982154fa3323ae5ca5a8d9b2e4a975f7 /core/java/android/webkit/ViewManager.java | |
parent | 0794cd33dd8c3019183cecb44119c56eee3c06f0 (diff) | |
download | frameworks_base-d222a16286c65ce1846b8d3b695eb481c94d2724.zip frameworks_base-d222a16286c65ce1846b8d3b695eb481c94d2724.tar.gz frameworks_base-d222a16286c65ce1846b8d3b695eb481c94d2724.tar.bz2 |
Plugin surfaces will be limited to 270% of the devices screen size.
Change-Id: I7e5ff1f5b8919b9e2e70a703009f9544f457a0e1
Diffstat (limited to 'core/java/android/webkit/ViewManager.java')
-rw-r--r-- | core/java/android/webkit/ViewManager.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/webkit/ViewManager.java b/core/java/android/webkit/ViewManager.java index 02f452b..4e0e081 100644 --- a/core/java/android/webkit/ViewManager.java +++ b/core/java/android/webkit/ViewManager.java @@ -29,7 +29,7 @@ class ViewManager { private boolean mReadyToDraw; // Threshold at which a surface is prevented from further increasing in size - private static final int MAX_SURFACE_THRESHOLD = 1000000; + private final int MAX_SURFACE_THRESHOLD; class ChildView { int x; @@ -103,6 +103,14 @@ class ViewManager { ViewManager(WebView w) { mWebView = w; + + int pixelArea = w.getResources().getDisplayMetrics().widthPixels * + w.getResources().getDisplayMetrics().heightPixels; + /* set the threshold to be 275% larger than the screen size. The + percentage is simply an estimation and is not based on anything but + basic trial-and-error tests run on multiple devices. + */ + MAX_SURFACE_THRESHOLD = (int)(pixelArea * 2.75); } ChildView createView() { |