Better field names for details object

This commit is contained in:
Cheng Zhao 2017-12-20 10:25:31 +09:00
Родитель 4d7b85bd01
Коммит 4fd8b04329
3 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -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.