feat: add session.setPermissionCheckHandler (#13925)
* feat: add session.setPermissionCheckHandler to handle syncornous permission checks vs requests * spec: add tests for session.setPermissionCheckHandler * docs: add docs for session.setPermissionCheckHandler * feat: add mediaType to media permission checks * chore: cleanup check impl
This commit is contained in:
parent
afdb6c5f90
commit
68da311ed1
10 changed files with 142 additions and 1 deletions
|
@ -23,6 +23,7 @@ class WebContentsPermissionHelper
|
|||
OPEN_EXTERNAL,
|
||||
};
|
||||
|
||||
// Asynchronous Requests
|
||||
void RequestFullscreenPermission(const base::Callback<void(bool)>& callback);
|
||||
void RequestMediaAccessPermission(
|
||||
const content::MediaStreamRequest& request,
|
||||
|
@ -34,6 +35,10 @@ class WebContentsPermissionHelper
|
|||
bool user_gesture,
|
||||
const GURL& url);
|
||||
|
||||
// Synchronous Checks
|
||||
bool CheckMediaAccessPermission(const GURL& security_origin,
|
||||
content::MediaStreamType type) const;
|
||||
|
||||
private:
|
||||
explicit WebContentsPermissionHelper(content::WebContents* web_contents);
|
||||
friend class content::WebContentsUserData<WebContentsPermissionHelper>;
|
||||
|
@ -43,6 +48,9 @@ class WebContentsPermissionHelper
|
|||
bool user_gesture = false,
|
||||
const base::DictionaryValue* details = nullptr);
|
||||
|
||||
bool CheckPermission(content::PermissionType permission,
|
||||
const base::DictionaryValue* details) const;
|
||||
|
||||
content::WebContents* web_contents_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WebContentsPermissionHelper);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue