Chromium Embedded Framework (CEF)  129.0.1+g463bda9+chromium-129.0.6668.12
CefPermissionHandler Class Reference

Implement this interface to handle events related to permission requests. More...

#include "include/cef_permission_handler.h"

Inheritance diagram for CefPermissionHandler:
CefBaseRefCounted

Public Member Functions

virtual bool OnRequestMediaAccessPermission (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, const CefString &requesting_origin, uint32_t requested_permissions, CefRefPtr< CefMediaAccessCallback > callback)
 Called when a page requests permission to access media. More...
 
virtual bool OnShowPermissionPrompt (CefRefPtr< CefBrowser > browser, uint64_t prompt_id, const CefString &requesting_origin, uint32_t requested_permissions, CefRefPtr< CefPermissionPromptCallback > callback)
 Called when a page should show a permission prompt. More...
 
virtual void OnDismissPermissionPrompt (CefRefPtr< CefBrowser > browser, uint64_t prompt_id, cef_permission_request_result_t result)
 Called when a permission prompt handled via OnShowPermissionPrompt is dismissed. More...
 
- Public Member Functions inherited from CefBaseRefCounted
virtual void AddRef () const =0
 Called to increment the reference count for the object. More...
 
virtual bool Release () const =0
 Called to decrement the reference count for the object. More...
 
virtual bool HasOneRef () const =0
 Returns true if the reference count is 1. More...
 
virtual bool HasAtLeastOneRef () const =0
 Returns true if the reference count is at least 1. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CefBaseRefCounted
virtual ~CefBaseRefCounted ()
 

Detailed Description

Implement this interface to handle events related to permission requests.

The methods of this class will be called on the browser process UI thread.

Member Function Documentation

◆ OnDismissPermissionPrompt()

virtual void CefPermissionHandler::OnDismissPermissionPrompt ( CefRefPtr< CefBrowser browser,
uint64_t  prompt_id,
cef_permission_request_result_t  result 
)
inlinevirtual

Called when a permission prompt handled via OnShowPermissionPrompt is dismissed.

|prompt_id| will match the value that was passed to OnShowPermissionPrompt. |result| will be the value passed to CefPermissionPromptCallback::Continue or CEF_PERMISSION_RESULT_IGNORE if the dialog was dismissed for other reasons such as navigation, browser closure, etc. This method will not be called if OnShowPermissionPrompt returned false for |prompt_id|.

◆ OnRequestMediaAccessPermission()

virtual bool CefPermissionHandler::OnRequestMediaAccessPermission ( CefRefPtr< CefBrowser browser,
CefRefPtr< CefFrame frame,
const CefString requesting_origin,
uint32_t  requested_permissions,
CefRefPtr< CefMediaAccessCallback callback 
)
inlinevirtual

Called when a page requests permission to access media.

|requesting_origin| is the URL origin requesting permission. |requested_permissions| is a combination of values from cef_media_access_permission_types_t that represent the requested permissions. Return true and call CefMediaAccessCallback methods either in this method or at a later time to continue or cancel the request. Return false to proceed with default handling. With Chrome style, default handling will display the permission request UI. With Alloy style, default handling will deny the request. This method will not be called if the "--enable-media-stream" command-line switch is used to grant all permissions.

◆ OnShowPermissionPrompt()

virtual bool CefPermissionHandler::OnShowPermissionPrompt ( CefRefPtr< CefBrowser browser,
uint64_t  prompt_id,
const CefString requesting_origin,
uint32_t  requested_permissions,
CefRefPtr< CefPermissionPromptCallback callback 
)
inlinevirtual

Called when a page should show a permission prompt.

|prompt_id| uniquely identifies the prompt. |requesting_origin| is the URL origin requesting permission. |requested_permissions| is a combination of values from cef_permission_request_types_t that represent the requested permissions. Return true and call CefPermissionPromptCallback::Continue either in this method or at a later time to continue or cancel the request. Return false to proceed with default handling. With Chrome style, default handling will display the permission prompt UI. With Alloy style, default handling is CEF_PERMISSION_RESULT_IGNORE.


The documentation for this class was generated from the following file: