Adds Java-side of logic to make Geolocation obey Browser 'Enable Location' setting.

This fixes bug http://b/issue?id=2067559.
This commit is contained in:
Steve Block
2009-08-21 10:26:37 +01:00
parent 3be63c0930
commit 06cd751b05

View File

@@ -167,6 +167,7 @@ public class WebSettings {
private boolean mDatabaseEnabled = false;
private boolean mDomStorageEnabled = false;
private boolean mWorkersEnabled = false; // only affects V8.
private boolean mGeolocationEnabled = false;
// HTML5 configuration parameters
private long mAppCacheMaxSize = Long.MAX_VALUE;
private String mAppCachePath = "";
@@ -1081,6 +1082,18 @@ public class WebSettings {
}
}
/**
* Sets whether Geolocation is enabled.
* @param flag Whether Geolocation should be enabled.
* @hide pending api council approval
*/
public synchronized void setGeolocationEnabled(boolean flag) {
if (mGeolocationEnabled != flag) {
mGeolocationEnabled = flag;
postSync();
}
}
/**
* Return true if javascript is enabled. <b>Note: The default is false.</b>
* @return True if javascript is enabled.