This source file includes following definitions.
- AllowMixedContent
- allowDisplayingInsecureContent
- allowRunningInsecureContent
- allowDisplayingInsecureContent
- allowRunningInsecureContent
#include "android_webview/renderer/aw_permission_client.h"
#include "content/public/renderer/render_frame.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "url/gurl.h"
namespace android_webview {
namespace {
bool AllowMixedContent(const blink::WebURL& url) {
GURL gurl(url);
return !gurl.IsStandard();
}
}
AwPermissionClient::AwPermissionClient(content::RenderFrame* render_frame)
: content::RenderFrameObserver(render_frame) {
render_frame->GetWebFrame()->setPermissionClient(this);
}
AwPermissionClient::~AwPermissionClient() {
}
bool AwPermissionClient::allowDisplayingInsecureContent(
blink::WebFrame* frame,
bool enabled_per_settings,
const blink::WebSecurityOrigin& origin,
const blink::WebURL& url) {
return allowDisplayingInsecureContent(enabled_per_settings, origin, url);
}
bool AwPermissionClient::allowRunningInsecureContent(
blink::WebFrame* frame,
bool enabled_per_settings,
const blink::WebSecurityOrigin& origin,
const blink::WebURL& url) {
return allowRunningInsecureContent(enabled_per_settings, origin, url);
}
bool AwPermissionClient::allowDisplayingInsecureContent(
bool enabled_per_settings,
const blink::WebSecurityOrigin& origin,
const blink::WebURL& url) {
return enabled_per_settings ? true : AllowMixedContent(url);
}
bool AwPermissionClient::allowRunningInsecureContent(
bool enabled_per_settings,
const blink::WebSecurityOrigin& origin,
const blink::WebURL& url) {
return enabled_per_settings ? true : AllowMixedContent(url);
}
}