summaryrefslogtreecommitdiffstats
path: root/android_webview/lib
diff options
context:
space:
mode:
authormnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 12:41:41 +0000
committermnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 12:41:41 +0000
commit354ba46913a133521e9f10ca7a72274c6b8bc31b (patch)
tree4eee49aa9b08db102269838cb0f1c18342e280aa /android_webview/lib
parent1052ff3757e6ec2e724f7a8ef714e8f9540c6f60 (diff)
downloadchromium_src-354ba46913a133521e9f10ca7a72274c6b8bc31b.zip
chromium_src-354ba46913a133521e9f10ca7a72274c6b8bc31b.tar.gz
chromium_src-354ba46913a133521e9f10ca7a72274c6b8bc31b.tar.bz2
[Android] Upstream WebView.allow{Content|File}Access implementation.
R=benm@chromium.org,joth@chromium.org BUG=153516 Review URL: https://chromiumcodereview.appspot.com/11090003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/lib')
-rw-r--r--android_webview/lib/aw_content_browser_client.cc11
-rw-r--r--android_webview/lib/aw_content_browser_client.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/android_webview/lib/aw_content_browser_client.cc b/android_webview/lib/aw_content_browser_client.cc
index 2a07343..d44a475 100644
--- a/android_webview/lib/aw_content_browser_client.cc
+++ b/android_webview/lib/aw_content_browser_client.cc
@@ -6,6 +6,9 @@
#include "android_webview/browser/aw_cookie_access_policy.h"
#include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h"
+#include "android_webview/common/url_constants.h"
+#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/render_process_host.h"
namespace android_webview {
@@ -16,6 +19,14 @@ AwContentBrowserClient::AwContentBrowserClient()
AwContentBrowserClient::~AwContentBrowserClient() {
}
+void AwContentBrowserClient::RenderProcessHostCreated(
+ content::RenderProcessHost* host) {
+ // Grant content: scheme to the whole process, since we impose per-view
+ // access checks.
+ content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
+ host->GetID(), android_webview::kContentScheme);
+}
+
void AwContentBrowserClient::ResourceDispatcherHostCreated() {
ChromeContentBrowserClient::ResourceDispatcherHostCreated();
AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated();
diff --git a/android_webview/lib/aw_content_browser_client.h b/android_webview/lib/aw_content_browser_client.h
index 8b75c99..a9a4cab 100644
--- a/android_webview/lib/aw_content_browser_client.h
+++ b/android_webview/lib/aw_content_browser_client.h
@@ -17,6 +17,8 @@ class AwContentBrowserClient : public chrome::ChromeContentBrowserClient {
virtual ~AwContentBrowserClient();
// Overriden methods from ContentBrowserClient.
+ virtual void RenderProcessHostCreated(
+ content::RenderProcessHost* host) OVERRIDE;
virtual void ResourceDispatcherHostCreated() OVERRIDE;
virtual bool AllowGetCookie(const GURL& url,
const GURL& first_party,