Java Code Examples for android.webkit.GeolocationPermissions#Callback

The following examples show how to use android.webkit.GeolocationPermissions#Callback . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultChromeClient.java    From AgentWeb with Apache License 2.0 6 votes vote down vote up
private void onGeolocationPermissionsShowPromptInternal(String origin, GeolocationPermissions.Callback callback) {
	if (mPermissionInterceptor != null) {
		if (mPermissionInterceptor.intercept(this.mWebView.getUrl(), AgentWebPermissions.LOCATION, "location")) {
			callback.invoke(origin, false, false);
			return;
		}
	}
	Activity mActivity = mActivityWeakReference.get();
	if (mActivity == null) {
		callback.invoke(origin, false, false);
		return;
	}
	List<String> deniedPermissions = null;
	if ((deniedPermissions = AgentWebUtils.getDeniedPermissions(mActivity, AgentWebPermissions.LOCATION)).isEmpty()) {
		LogUtils.i(TAG, "onGeolocationPermissionsShowPromptInternal:" + true);
		callback.invoke(origin, true, false);
	} else {
		Action mAction = Action.createPermissionsAction(deniedPermissions.toArray(new String[]{}));
		mAction.setFromIntention(FROM_CODE_INTENTION_LOCATION);
		ActionActivity.setPermissionListener(mPermissionListener);
		this.mCallback = callback;
		this.mOrigin = origin;
		ActionActivity.start(mActivity, mAction);
	}
}
 
Example 2
Source File: MainActivity.java    From FaceSlim with GNU General Public License v2.0 5 votes vote down vote up
public void onGeolocationPermissionsShowPrompt(String origin,
                                               GeolocationPermissions.Callback callback) {
    /** Request location permission.
     *  If granted it's awesome and go on,
     *  otherwise just stop here and leave the method.
     */
    requestLocationPermission();
    if (!hasLocationPermission())
        return;

    callback.invoke(origin, true, false);
}
 
Example 3
Source File: ProxyWebChromeClient.java    From robotium-extensions with Apache License 2.0 5 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    if (originalWebChromeClient != null) {
        originalWebChromeClient.onGeolocationPermissionsShowPrompt(origin, callback);
    } else {
        super.onGeolocationPermissionsShowPrompt(origin, callback);
    }
}
 
Example 4
Source File: MainActivity.java    From privatelocation with GNU General Public License v3.0 5 votes vote down vote up
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);

    if(isLocationPermissionGranted()){
        findLocation();
    }
}
 
Example 5
Source File: Html5Webview.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);
}
 
Example 6
Source File: RexxarWebChromeClient.java    From rexxar-android with MIT License 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
                                               GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);
}
 
Example 7
Source File: AwContentsClient.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public abstract void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback);
 
Example 8
Source File: Html5Webview.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);
}
 
Example 9
Source File: PrivateActivity.java    From SimplicityBrowser with MIT License 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);
    super.onGeolocationPermissionsShowPrompt(origin, callback);
}
 
Example 10
Source File: HTML5WebView.java    From BigApp_Discuz_Android with Apache License 2.0 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);
}
 
Example 11
Source File: BaseWebView.java    From evercam-android with GNU Affero General Public License v3.0 4 votes vote down vote up
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions
        .Callback callback) {
    callback.invoke(origin, true, false);
}
 
Example 12
Source File: Html5Activity.java    From ClassSchedule with Apache License 2.0 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(final String origin, final GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);//注意个函数,第二个参数就是是否同意定位权限,第三个是是否希望内核记住
    super.onGeolocationPermissionsShowPrompt(origin, callback);
}
 
Example 13
Source File: NullContentsClient.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
        GeolocationPermissions.Callback callback) {
}
 
Example 14
Source File: RobotiumWebClient.java    From AndroidRipper with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
	if (originalWebChromeClient != null) {
		originalWebChromeClient.onGeolocationPermissionsShowPrompt(origin, callback);
	} 
}
 
Example 15
Source File: AwContentsClient.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public abstract void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback);
 
Example 16
Source File: NullContentsClient.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
        GeolocationPermissions.Callback callback) {
}
 
Example 17
Source File: VideoEnabledWebChromeClient.java    From carstream-android-auto with Apache License 2.0 4 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    super.onGeolocationPermissionsShowPrompt(origin, callback);
    callback.invoke(origin, true, true);
}
 
Example 18
Source File: QuickWebChromeClient.java    From quickhybrid-android with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * 请求定位
 *
 * @param origin
 * @param callback
 */
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);
    super.onGeolocationPermissionsShowPrompt(origin, callback);
}
 
Example 19
Source File: WebChromeClientListener.java    From JsBridge with MIT License 2 votes vote down vote up
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {

}
 
Example 20
Source File: RideRequestView.java    From rides-android-sdk with MIT License 2 votes vote down vote up
/**
 * The default implementation does nothing, so permission is never obtained and passed to Javascript.
 * Overriding to always gain permission as {@link RideRequestView} assumes the app has already gained
 * location permissions.
 */
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
    callback.invoke(origin, true, false);
}