зеркало из https://github.com/electron/electron.git
Better field names for details object
This commit is contained in:
Родитель
4d7b85bd01
Коммит
4fd8b04329
|
@ -69,8 +69,8 @@ void WebContentsPermissionHelper::RequestPermissionWithDetails(
|
|||
web_contents_->GetBrowserContext()->GetPermissionManager());
|
||||
auto origin = web_contents_->GetLastCommittedURL();
|
||||
permission_manager->RequestPermissionWithDetails(
|
||||
permission, rfh, origin, false, details,
|
||||
base::Bind(&OnPermissionResponse, callback));
|
||||
permission, rfh, origin, false, details,
|
||||
base::Bind(&OnPermissionResponse, callback));
|
||||
}
|
||||
|
||||
void WebContentsPermissionHelper::RequestFullscreenPermission(
|
||||
|
@ -106,8 +106,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
|||
bool user_gesture,
|
||||
const GURL& url) {
|
||||
base::DictionaryValue details;
|
||||
details.SetString("scheme", url.scheme());
|
||||
details.SetString("url", url.spec());
|
||||
details.SetString("externalURL", url.spec());
|
||||
RequestPermissionWithDetails(
|
||||
static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL),
|
||||
callback, user_gesture, &details);
|
||||
|
|
|
@ -45,10 +45,10 @@ class WebContentsPermissionHelper
|
|||
const base::Callback<void(bool)>& callback,
|
||||
bool user_gesture = false);
|
||||
void RequestPermissionWithDetails(
|
||||
content::PermissionType permission,
|
||||
const base::Callback<void(bool)>& callback,
|
||||
bool user_gesture,
|
||||
const base::DictionaryValue* details);
|
||||
content::PermissionType permission,
|
||||
const base::Callback<void(bool)>& callback,
|
||||
bool user_gesture,
|
||||
const base::DictionaryValue* details);
|
||||
|
||||
content::WebContents* web_contents_;
|
||||
|
||||
|
|
|
@ -294,8 +294,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
|
|||
* `callback` Function
|
||||
* `permissionGranted` Boolean - Allow or deny the permission.
|
||||
* `details` Object - Some properties are only available on certain permission types.
|
||||
* `url` String - The url of the `openExternal` request.
|
||||
* `scheme` String - The protocol scheme of the `openExternal` request.
|
||||
* `externalURL` String - The url of the `openExternal` request.
|
||||
|
||||
Sets the handler which can be used to respond to permission requests for the `session`.
|
||||
Calling `callback(true)` will allow the permission and `callback(false)` will reject it.
|
||||
|
|
Загрузка…
Ссылка в новой задаче