mirror of
https://github.com/electron/electron.git
synced 2026-01-27 16:28:23 -05:00
Reduce the number of helpers
This commit is contained in:
@@ -53,13 +53,6 @@ WebContentsPermissionHelper::~WebContentsPermissionHelper() {
|
||||
}
|
||||
|
||||
void WebContentsPermissionHelper::RequestPermission(
|
||||
content::PermissionType permission,
|
||||
const base::Callback<void(bool)>& callback,
|
||||
bool user_gesture) {
|
||||
RequestPermissionWithDetails(permission, callback, user_gesture, nullptr);
|
||||
}
|
||||
|
||||
void WebContentsPermissionHelper::RequestPermissionWithDetails(
|
||||
content::PermissionType permission,
|
||||
const base::Callback<void(bool)>& callback,
|
||||
bool user_gesture,
|
||||
@@ -107,7 +100,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
||||
const GURL& url) {
|
||||
base::DictionaryValue details;
|
||||
details.SetString("externalURL", url.spec());
|
||||
RequestPermissionWithDetails(
|
||||
RequestPermission(
|
||||
static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL),
|
||||
callback, user_gesture, &details);
|
||||
}
|
||||
|
||||
@@ -43,12 +43,8 @@ class WebContentsPermissionHelper
|
||||
void RequestPermission(
|
||||
content::PermissionType permission,
|
||||
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);
|
||||
bool user_gesture = false,
|
||||
const base::DictionaryValue* details = nullptr);
|
||||
|
||||
content::WebContents* web_contents_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user