diff options
author | Grace Kloba <klobag@google.com> | 2009-06-25 11:42:46 -0700 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2009-06-25 11:42:46 -0700 |
commit | d1ebf538a9f475ef9ac34480ef7ce742454bc899 (patch) | |
tree | 05e8d0459a47039b4445690669934987c3aeed33 /core/java/android/webkit/WebSettings.java | |
parent | c889f13ec05e3b28e05df1f19c2cc6306f3871af (diff) | |
parent | 0d8b77c2453d0e597f94e39212e4bfeed8affffa (diff) | |
download | frameworks_base-d1ebf538a9f475ef9ac34480ef7ce742454bc899.zip frameworks_base-d1ebf538a9f475ef9ac34480ef7ce742454bc899.tar.gz frameworks_base-d1ebf538a9f475ef9ac34480ef7ce742454bc899.tar.bz2 |
resolved conflicts for merge of 0d8b77c2 to master
Diffstat (limited to 'core/java/android/webkit/WebSettings.java')
-rw-r--r-- | core/java/android/webkit/WebSettings.java | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index f57c647..3a98ff2 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -69,7 +69,24 @@ public class WebSettings { } int value; } - + + /** + * Enum for specifying the WebView's desired density. + * FAR makes 100% looking like in 240dpi + * MEDIUM makes 100% looking like in 160dpi + * CLOSE makes 100% looking like in 120dpi + * @hide Pending API council approval + */ + public enum ZoomDensity { + FAR(150), // 240dpi + MEDIUM(100), // 160dpi + CLOSE(75); // 120dpi + ZoomDensity(int size) { + value = size; + } + int value; + } + /** * Default cache usage pattern Use with {@link #setCacheMode}. */ @@ -105,6 +122,8 @@ public class WebSettings { LOW } + // WebView associated with this WebSettings. + private WebView mWebView; // BrowserFrame used to access the native frame pointer. private BrowserFrame mBrowserFrame; // Flag to prevent multiple SYNC messages at one time. @@ -149,6 +168,7 @@ public class WebSettings { // Don't need to synchronize the get/set methods as they // are basic types, also none of these values are used in // native WebCore code. + private ZoomDensity mDefaultZoom = ZoomDensity.MEDIUM; private RenderPriority mRenderPriority = RenderPriority.NORMAL; private int mOverrideCacheMode = LOAD_DEFAULT; private boolean mSaveFormData = true; @@ -246,9 +266,10 @@ public class WebSettings { * Package constructor to prevent clients from creating a new settings * instance. */ - WebSettings(Context context) { + WebSettings(Context context, WebView webview) { mEventHandler = new EventHandler(); mContext = context; + mWebView = webview; mDefaultTextEncoding = context.getString(com.android.internal. R.string.default_text_encoding); @@ -456,6 +477,31 @@ public class WebSettings { } /** + * Set the default zoom density of the page. This should be called from UI + * thread. + * @param zoom A ZoomDensity value + * @see WebSettings.ZoomDensity + * @hide Pending API council approval + */ + public void setDefaultZoom(ZoomDensity zoom) { + if (mDefaultZoom != zoom) { + mDefaultZoom = zoom; + mWebView.updateDefaultZoomDensity(zoom.value); + } + } + + /** + * Get the default zoom density of the page. This should be called from UI + * thread. + * @return A ZoomDensity value + * @see WebSettings.ZoomDensity + * @hide Pending API council approval + */ + public ZoomDensity getDefaultZoom() { + return mDefaultZoom; + } + + /** * Enables using light touches to make a selection and activate mouseovers. */ public void setLightTouchEnabled(boolean enabled) { |