mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-04-13 18:32:07 +02:00
Popup windows will be created on the display that best matches the requested coordinates. The requested size will apply to the content area (as required by JS documentation) and window size will be reduced if necessary to fit within the target display. The requested origin will apply to the window (including frame) and will be modified if necessary so that the window is fully visible on the target display. This change does not implement popup positioning for cefclient which uses an application-created parent window. This change grants access to the getScreenDetails JS API without user prompt.
68 lines
2.9 KiB
C++
68 lines
2.9 KiB
C++
// Copyright 2022 The Chromium Embedded Framework Authors. Portions copyright
|
|
// 2015 The Chromium Authors. All rights reserved. Use of this source code is
|
|
// governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_PERMISSION_MANAGER_H_
|
|
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_PERMISSION_MANAGER_H_
|
|
#pragma once
|
|
|
|
#include "base/callback_forward.h"
|
|
#include "content/public/browser/permission_controller_delegate.h"
|
|
|
|
// Permision manager implementations that only allows WINDOW_PLACEMENT API
|
|
class AlloyPermissionManager : public content::PermissionControllerDelegate {
|
|
public:
|
|
AlloyPermissionManager() = default;
|
|
|
|
AlloyPermissionManager(const AlloyPermissionManager&) = delete;
|
|
AlloyPermissionManager& operator=(const AlloyPermissionManager&) = delete;
|
|
|
|
// PermissionManager implementation.
|
|
void RequestPermission(
|
|
blink::PermissionType permission,
|
|
content::RenderFrameHost* render_frame_host,
|
|
const GURL& requesting_origin,
|
|
bool user_gesture,
|
|
base::OnceCallback<void(blink::mojom::PermissionStatus)> callback)
|
|
override;
|
|
void RequestPermissions(
|
|
const std::vector<blink::PermissionType>& permission,
|
|
content::RenderFrameHost* render_frame_host,
|
|
const GURL& requesting_origin,
|
|
bool user_gesture,
|
|
base::OnceCallback<
|
|
void(const std::vector<blink::mojom::PermissionStatus>&)> callback)
|
|
override;
|
|
void RequestPermissionsFromCurrentDocument(
|
|
const std::vector<blink::PermissionType>& permissions,
|
|
content::RenderFrameHost* render_frame_host,
|
|
bool user_gesture,
|
|
base::OnceCallback<
|
|
void(const std::vector<blink::mojom::PermissionStatus>&)> callback)
|
|
override;
|
|
blink::mojom::PermissionStatus GetPermissionStatus(
|
|
blink::PermissionType permission,
|
|
const GURL& requesting_origin,
|
|
const GURL& embedding_origin) override;
|
|
blink::mojom::PermissionStatus GetPermissionStatusForCurrentDocument(
|
|
blink::PermissionType permission,
|
|
content::RenderFrameHost* render_frame_host) override;
|
|
blink::mojom::PermissionStatus GetPermissionStatusForWorker(
|
|
blink::PermissionType permission,
|
|
content::RenderProcessHost* render_process_host,
|
|
const GURL& worker_origin) override;
|
|
void ResetPermission(blink::PermissionType permission,
|
|
const GURL& requesting_origin,
|
|
const GURL& embedding_origin) override;
|
|
SubscriptionId SubscribePermissionStatusChange(
|
|
blink::PermissionType permission,
|
|
content::RenderProcessHost* render_process_host,
|
|
content::RenderFrameHost* render_frame_host,
|
|
const GURL& requesting_origin,
|
|
base::RepeatingCallback<void(blink::mojom::PermissionStatus)> callback)
|
|
override;
|
|
void UnsubscribePermissionStatusChange(
|
|
SubscriptionId subscription_id) override;
|
|
};
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_PERMISSION_MANAGER_H_
|