当前位置: 首页>>代码示例>>Java>>正文


Java GeolocationPermissions.Callback方法代码示例

本文整理汇总了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);
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:21,代码来源:CBrowserMainFrame7.java

示例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);
}
 
开发者ID:jiangkang,项目名称:KTools,代码行数:6,代码来源:KWebChromeClient.java

示例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);

}
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:10,代码来源:WebChromeClientWrapper.java

示例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);
}
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:11,代码来源:DefaultChromeClient.java

示例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);
        }


    }
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:32,代码来源:DefaultChromeClient.java

示例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);
}
 
开发者ID:wzx54321,项目名称:XinFramework,代码行数:11,代码来源:WebModel.java

示例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);
}
 
开发者ID:fendoudebb,项目名称:PlayAndroid,代码行数:9,代码来源:WebViewActivity.java

示例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);
    }
}
 
开发者ID:bitbar,项目名称:robotium-extensions,代码行数:9,代码来源:ProxyWebChromeClient.java

示例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);
}
 
开发者ID:gsurrel,项目名称:MessengerBypasser,代码行数:17,代码来源:FacebookWebChromeClient.java

示例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);
    }
}
 
开发者ID:yyter,项目名称:SafeWebView,代码行数:8,代码来源:SafeWebView.java

示例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);
}
 
开发者ID:indywidualny,项目名称:FaceSlim,代码行数:13,代码来源:MainActivity.java

示例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);
}
 
开发者ID:rignaneseleo,项目名称:SlimSocial-for-Facebook,代码行数:36,代码来源:MainActivity.java

示例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);
}
 
开发者ID:maksim-m,项目名称:KitAlumniApp-Client,代码行数:8,代码来源:KitNaviFragment.java

示例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();
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:11,代码来源:WebViewContentsClientAdapter.java

示例15: onGeolocationPermissionsShowPrompt

import android.webkit.GeolocationPermissions; //导入方法依赖的package包/类
@Override
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
	super.onGeolocationPermissionsShowPrompt(origin, callback);
}
 
开发者ID:fengshihao,项目名称:WebPager,代码行数:5,代码来源:PagerChromeClient.java


注:本文中的android.webkit.GeolocationPermissions.Callback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。