Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2349)

Unified Diff: android_webview/renderer/aw_permission_client.cc

Issue 104833006: Switch ContentSettingsObserver to be a RenderFrameObserver instead of a RenderViewObserver (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/renderer/aw_permission_client.h ('k') | android_webview/renderer/aw_render_view_ext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/renderer/aw_permission_client.cc
===================================================================
--- android_webview/renderer/aw_permission_client.cc (revision 0)
+++ android_webview/renderer/aw_permission_client.cc (revision 0)
@@ -0,0 +1,53 @@
+// Copyright 2013 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.
+
+#include "android_webview/renderer/aw_permission_client.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) {
+ // We treat non-standard schemes as "secure" in the WebView to allow them to
+ // be used for request interception.
+ // TODO(benm): Tighten this restriction by requiring embedders to register
+ // their custom schemes? See b/9420953.
+ GURL gurl(url);
+ return !gurl.IsStandard();
+}
+
+}
+
+AwPermissionClient::AwPermissionClient(content::RenderFrame* render_frame)
+ : content::RenderFrameObserver(render_frame){
+}
+
+AwPermissionClient::~AwPermissionClient() {
+}
+
+void AwPermissionClient::WebFrameCreated(blink::WebFrame* frame) {
+ frame->setPermissionClient(this);
+}
+
+bool AwPermissionClient::allowDisplayingInsecureContent(
+ blink::WebFrame* frame,
+ bool enabled_per_settings,
+ const blink::WebSecurityOrigin& origin,
+ const blink::WebURL& url) {
+ return enabled_per_settings ? true : AllowMixedContent(url);
+}
+
+bool AwPermissionClient::allowRunningInsecureContent(
+ blink::WebFrame* frame,
+ bool enabled_per_settings,
+ const blink::WebSecurityOrigin& origin,
+ const blink::WebURL& url) {
+ return enabled_per_settings ? true : AllowMixedContent(url);
+}
+
+} // namespace android_webview
Property changes on: android_webview\renderer\aw_permission_client.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « android_webview/renderer/aw_permission_client.h ('k') | android_webview/renderer/aw_render_view_ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698