android.webkit.PermissionRequest Java Examples

The following examples show how to use android.webkit.PermissionRequest. 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: SystemWebChromeClient.java    From xmall with MIT License 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #2
Source File: MainActivity.java    From chromium-webview-samples with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_main, container, false);
    mWebRTCWebView = (WebView) rootView.findViewById(R.id.fragment_main_webview);

    setUpWebViewDefaults(mWebRTCWebView);

    mWebRTCWebView.loadUrl("https://apprtc-m.appspot.com/");

    mWebRTCWebView.setWebChromeClient(new WebChromeClient() {

        @Override
        public void onPermissionRequest(final PermissionRequest request) {
            Log.d(TAG, "onPermissionRequest");
            getActivity().runOnUiThread(new Runnable() {
                @TargetApi(Build.VERSION_CODES.L)
                @Override
                public void run() {
                    if(request.getOrigin().toString().equals("https://apprtc-m.appspot.com/")) {
                        request.grant(request.getResources());
                    } else {
                        request.deny();
                    }
                }
            });
        }

    });

    return rootView;
}
 
Example #3
Source File: PermissionRequestFragment.java    From android-PermissionRequest with Apache License 2.0 5 votes vote down vote up
@Override
public void onPermissionRequestCanceled(PermissionRequest request) {
    Log.i(TAG, "onPermissionRequestCanceled");
    // We dismiss the prompt UI here as the request is no longer valid.
    mPermissionRequest = null;
    DialogFragment fragment = (DialogFragment) getChildFragmentManager()
            .findFragmentByTag(FRAGMENT_DIALOG);
    if (null != fragment) {
        fragment.dismiss();
    }
}
 
Example #4
Source File: PermissionRequestFragment.java    From android-PermissionRequest with Apache License 2.0 5 votes vote down vote up
@Override
public void onPermissionRequest(PermissionRequest request) {
    Log.i(TAG, "onPermissionRequest");
    mPermissionRequest = request;
    final String[] requestedResources = request.getResources();
    for (String r : requestedResources) {
        if (r.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) {
            // In this sample, we only accept video capture request.
            ConfirmationDialogFragment
                    .newInstance(new String[]{PermissionRequest.RESOURCE_VIDEO_CAPTURE})
                    .show(getChildFragmentManager(), FRAGMENT_DIALOG);
            break;
        }
    }
}
 
Example #5
Source File: CommonRefreshWebViewActivity.java    From BaseProject with Apache License 2.0 5 votes vote down vote up
@Override
public void onPermissionRequest(PermissionRequest request) {
    boolean subClassAllow = onWebChromePermissonRequest(request);
    if (!subClassAllow) {
        super.onPermissionRequest(request);
    }
}
 
Example #6
Source File: MainActivity.java    From SimplicityBrowser with MIT License 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        request.grant(request.getResources());
    }
}
 
Example #7
Source File: WebPlayerView.java    From unity-ads-android with Apache License 2.0 5 votes vote down vote up
@Override
public void onPermissionRequest(PermissionRequest request) {
	if (shouldCallSuper("onPermissionRequest")) {
		super.onPermissionRequest(request);
	}
	if (shouldSendEvent("onPermissionRequest")) {
		String url = "";
		if (request != null && request.getOrigin() != null) {
			url = request.getOrigin().toString();
		}
		WebViewApp.getCurrentApp().sendEvent(WebViewEventCategory.WEBPLAYER, WebPlayerEvent.PERMISSION_REQUEST, url, viewId);
	}
}
 
Example #8
Source File: VideoEnabledWebChromeClient.java    From carstream-android-auto with Apache License 2.0 5 votes vote down vote up
@Override
public void onPermissionRequest(PermissionRequest request) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        request.grant(request.getResources());
    }
}
 
Example #9
Source File: WebChromeClientDelegate.java    From AgentWeb with Apache License 2.0 5 votes vote down vote up
@Override
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequestCanceled(PermissionRequest request) {

    if (this.mDelegate != null) {
        this.mDelegate.onPermissionRequestCanceled(request);
        return;
    }
    super.onPermissionRequestCanceled(request);
}
 
Example #10
Source File: WebChromeClientDelegate.java    From AgentWeb with Apache License 2.0 5 votes vote down vote up
@Override
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(PermissionRequest request) {
    if (this.mDelegate != null) {
        this.mDelegate.onPermissionRequest(request);
        return;
    }
    super.onPermissionRequest(request);
}
 
Example #11
Source File: X5WebChromeClient.java    From cordova-plugin-x5-webview with Apache License 2.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #12
Source File: SystemWebChromeClient.java    From countly-sdk-cordova with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #13
Source File: SystemWebChromeClient.java    From BigDataPlatform with GNU General Public License v3.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #14
Source File: SystemWebChromeClient.java    From lona with GNU General Public License v3.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #15
Source File: SystemWebChromeClient.java    From ultimate-cordova-webview-app with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #16
Source File: SystemWebChromeClient.java    From pychat with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #17
Source File: SystemWebChromeClient.java    From cordova-plugin-intent with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #18
Source File: SystemWebChromeClient.java    From a2cardboard with Apache License 2.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #19
Source File: SystemWebChromeClient.java    From cordova-plugin-app-update-demo with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #20
Source File: MyWebChromeClient.java    From ByWebView with Apache License 2.0 4 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(PermissionRequest request) {
    super.onPermissionRequest(request);
    request.grant(request.getResources());
}
 
Example #21
Source File: ByWebChromeClient.java    From ByWebView with Apache License 2.0 4 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(PermissionRequest request) {
    super.onPermissionRequest(request);
    request.grant(request.getResources());
}
 
Example #22
Source File: CommonRefreshWebViewActivity.java    From BaseProject with Apache License 2.0 4 votes vote down vote up
protected boolean onWebChromePermissonRequest(PermissionRequest permissionRequest) {
    return false;
}
 
Example #23
Source File: PrivateActivity.java    From SimplicityBrowser with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        request.grant(request.getResources());
    }
}
 
Example #24
Source File: TubiVPAID.java    From TubiPlayer with MIT License 4 votes vote down vote up
/**
 * We override this here to keep taps on VPAID ads that abuse their power
 *
 * @param request details around the permission request, see {@link PermissionRequest}
 */
@Override
public void onPermissionRequest(PermissionRequest request) {
    if (Build.VERSION.SDK_INT >= 21)
        request.deny();
}
 
Example #25
Source File: X5WebChromeClient.java    From cordova-plugin-x5engine-webview with Apache License 2.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
    Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #26
Source File: SystemWebChromeClient.java    From app-icon with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #27
Source File: X5WebChromeClient.java    From cordova-plugin-x5-tbs with Apache License 2.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
  Log.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
  request.grant(request.getResources());
}
 
Example #28
Source File: SystemWebChromeClient.java    From keemob with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #29
Source File: SystemWebChromeClient.java    From keemob with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(final PermissionRequest request) {
    LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
    request.grant(request.getResources());
}
 
Example #30
Source File: ProWebView.java    From prowebview with Apache License 2.0 4 votes vote down vote up
@RequiresApi(21)
void onPermissionRequested(PermissionRequest permissionRequest);