3525774: Add GPSForCurrentDocument() into PermissionControllerDelegate.

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3525774

refactor: copy upstream impl of GetPermissionStatusForCurrentDocument into +ElectronPermissionManager
This commit is contained in:
Charles Kerr 2022-03-23 12:35:20 -05:00
Родитель f27750d6d7
Коммит d0981c4d6c
2 изменённых файлов: 13 добавлений и 0 удалений

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

@ -9,6 +9,7 @@
#include <vector>
#include "base/values.h"
#include "content/browser/permissions/permission_util.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/permission_controller.h"
@ -398,4 +399,13 @@ ElectronPermissionManager::GetPermissionStatusForFrame(
: blink::mojom::PermissionStatus::DENIED;
}
blink::mojom::PermissionStatus
ElectronPermissionManager::GetPermissionStatusForCurrentDocument(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host) {
return GetPermissionStatus(
permission, render_frame_host->GetLastCommittedOrigin().GetURL(),
content::PermissionUtil::GetLastCommittedOriginAsURL(render_frame_host));
}
} // namespace electron

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

@ -85,6 +85,9 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin) override;
blink::mojom::PermissionStatus GetPermissionStatusForCurrentDocument(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host) override;
bool CheckPermissionWithDetails(content::PermissionType permission,
content::RenderFrameHost* render_frame_host,