mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add the ability to restrict V8 extension loading by frame using a new CefPermissionHandler::OnBeforeScriptExtensionLoad() callback (issue #471).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@457 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -475,6 +475,25 @@ int BrowserWebViewDelegate::historyForwardListCount() {
|
||||
- current_index - 1;
|
||||
}
|
||||
|
||||
// WebPermissionClient -------------------------------------------------------
|
||||
|
||||
bool BrowserWebViewDelegate::allowScriptExtension(
|
||||
WebKit::WebFrame* frame,
|
||||
const WebKit::WebString& extensionName,
|
||||
int extensionGroup) {
|
||||
bool allowExtension = true;
|
||||
CefRefPtr<CefClient> client = browser_->GetClient();
|
||||
if (client.get()) {
|
||||
CefRefPtr<CefPermissionHandler> handler = client->GetPermissionHandler();
|
||||
if (handler.get()) {
|
||||
CefString extensionNameStr = string16(extensionName);
|
||||
allowExtension = !handler->OnBeforeScriptExtensionLoad(
|
||||
browser_, browser_->UIT_GetCefFrame(frame), extensionNameStr);
|
||||
}
|
||||
}
|
||||
return allowExtension;
|
||||
}
|
||||
|
||||
// WebPluginPageDelegate -----------------------------------------------------
|
||||
|
||||
WebCookieJar* BrowserWebViewDelegate::GetCookieJar() {
|
||||
|
Reference in New Issue
Block a user