Exemplo n.º 1
0
 /// <summary>
 /// Called when the web content is requesting permission to access some resources.
 /// </summary>
 /// <param name="request">Request.</param>
 public override void OnPermissionRequest(Android.Webkit.PermissionRequest request)
 {
     Log.Info(PermissionRequestFragment.TAG, "onPermissionRequest");
     permissionReqFrag.mPermissionRequest = request;
     ConfirmationDialogFragment.NewInstance(request.GetResources())
     .Show(permissionReqFrag.ChildFragmentManager, FRAGMENT_DIALOG);
 }
Exemplo n.º 2
0
            /// <summary>
            /// Called when the permission request is canceled by the web content.
            /// </summary>
            /// <param name="request">Request.</param>
            public override void OnPermissionRequestCanceled(Android.Webkit.PermissionRequest request)
            {
                Log.Info(TAG, "onPermissionRequestCanceled");
                // We dismiss the prompt UI here as the request is no longer valid.
                permissionReqFrag.mPermissionRequest = null;
                DialogFragment fragment = (DialogFragment)permissionReqFrag.ChildFragmentManager
                                          .FindFragmentByTag(FRAGMENT_DIALOG);

                if (null != fragment)
                {
                    fragment.Dismiss();
                }
            }
Exemplo n.º 3
0
 public void OnConfirmation(bool allowed)
 {
     if (allowed)
     {
         mPermissionRequest.Grant(mPermissionRequest.GetResources());
         Log.Debug(TAG, "Permission granted.");
     }
     else
     {
         mPermissionRequest.Deny();
         Log.Debug(TAG, "Permission request denied.");
     }
     mPermissionRequest = null;
 }
		public void OnConfirmation (bool allowed)
		{
			if (allowed) {
				mPermissionRequest.Grant (mPermissionRequest.GetResources ());
				Log.Debug (TAG, "Permission granted.");
			} else {
				mPermissionRequest.Deny ();
				Log.Debug (TAG, "Permission request denied.");
			}
			mPermissionRequest = null;
		}