本文整理汇总了Java中android.webkit.GeolocationPermissions.Callback方法的典型用法代码示例。如果您正苦于以下问题:Java GeolocationPermissions.Callback方法的具体用法?Java GeolocationPermissions.Callback怎么用?Java GeolocationPermissions.Callback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.webkit.GeolocationPermissions
的用法示例。
在下文中一共展示了GeolocationPermissions.Callback方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(final String origin, final GeolocationPermissions.Callback callback) {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setMessage("是否允许获取您的位置信息?");
DialogInterface.OnClickListener dialogButtonOnClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int clickedButton) {
if (DialogInterface.BUTTON_POSITIVE == clickedButton) {
callback.invoke(origin, true, true);
} else if (DialogInterface.BUTTON_NEGATIVE == clickedButton) {
callback.invoke(origin, false, false);
}
}
};
builder.setPositiveButton("允许", dialogButtonOnClickListener);
builder.setNegativeButton("拒绝", dialogButtonOnClickListener);
builder.show();
super.onGeolocationPermissionsShowPrompt(origin, callback);
}
示例2: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
super.onGeolocationPermissionsShowPrompt(origin, callback);
callback.invoke(origin,true,true);
}
示例3: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
public void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback) {
if (this.mRealWebChromeClient != null){
this.mRealWebChromeClient.onGeolocationPermissionsShowPrompt(origin, callback);
return;
}
super.onGeolocationPermissionsShowPrompt(origin,callback);
}
示例4: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
LogUtils.i(TAG, "onGeolocationPermissionsShowPrompt:" + origin + " callback:" + callback);
if (AgentWebUtils.isOverriedMethod(mWebChromeClient, "onGeolocationPermissionsShowPrompt", "public void " + ChromePath + ".onGeolocationPermissionsShowPrompt", String.class, GeolocationPermissions.Callback.class)) {
super.onGeolocationPermissionsShowPrompt(origin, callback);
return;
}
onGeolocationPermissionsShowPromptInternal(origin, callback);
}
示例5: onGeolocationPermissionsShowPromptInternal
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
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.origin = origin;
ActionActivity.start(mActivity, mAction);
}
}
示例6: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(final String origin,
final GeolocationPermissions.Callback callback) {
callback.invoke(origin,
true,
true);
super.onGeolocationPermissionsShowPrompt(origin,
callback);
}
示例7: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions
.Callback callback) {
Log.d(TAG, "onGeolocationPermissionsShowPrompt() called with: origin = [" +
origin + "], callback = [" + callback + "]");
callback.invoke(origin, true, true);
super.onGeolocationPermissionsShowPrompt(origin, callback);
}
示例8: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
if (originalWebChromeClient != null) {
originalWebChromeClient.onGeolocationPermissionsShowPrompt(origin, callback);
} else {
super.onGeolocationPermissionsShowPrompt(origin, callback);
}
}
示例9: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback) {
// If we are not allowed to use geolocation, show an alert, if possible.
if (!mAllowGeolocation) {
if (mListener != null) {
mListener.showGeolocationDisabledAlert();
}
}
// Invoke the callback stating whether or not geolocation is allowed
callback.invoke(origin, mAllowGeolocation, false);
}
示例10: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
super.onGeolocationPermissionsShowPrompt(origin, callback);
if(client != null) {
client.onGeolocationPermissionsShowPrompt(origin, callback);
}
}
示例11: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
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);
}
示例12: SetupFullScreenVideo
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
private void SetupFullScreenVideo() {
//full screen video
mTargetView = (FrameLayout) findViewById(R.id.target_view);
myWebChromeClient = new WebChromeClient() {
//this custom WebChromeClient allow to show video on full screen
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {
mCustomViewCallback = callback;
mTargetView.addView(view);
mCustomView = view;
swipeRefreshLayout.setVisibility(View.GONE);
mTargetView.setVisibility(View.VISIBLE);
mTargetView.bringToFront();
}
@Override
public void onHideCustomView() {
if (mCustomView == null)
return;
mCustomView.setVisibility(View.GONE);
mTargetView.removeView(mCustomView);
mCustomView = null;
mTargetView.setVisibility(View.GONE);
mCustomViewCallback.onCustomViewHidden();
swipeRefreshLayout.setVisibility(View.VISIBLE);
}
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
callback.invoke(origin, true, false);
}
};
webViewFacebook.setWebChromeClient(myWebChromeClient);
}
示例13: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback) {
// Always grant permission since the app itself requires location
// permission and the user has therefore already granted it
callback.invoke(origin, true, false);
}
示例14: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback) {
TraceEvent.begin();
if (mWebChromeClient != null) {
if (TRACE) Log.d(TAG, "onGeolocationPermissionsShowPrompt");
mWebChromeClient.onGeolocationPermissionsShowPrompt(origin, callback);
}
TraceEvent.end();
}
示例15: onGeolocationPermissionsShowPrompt
import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
super.onGeolocationPermissionsShowPrompt(origin, callback);
}