diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-03 12:13:48 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-03 12:13:48 +0000 |
commit | a21767477fef894a75d0b13a8da3da6cdc2f5e3e (patch) | |
tree | e45f5c969518b6a64ed54fc8d96ba28f4736aae7 /chrome/browser/child_process_security_policy.cc | |
parent | 13c68582fc7a22a18cde190d09393912124f75b0 (diff) | |
download | chromium_src-a21767477fef894a75d0b13a8da3da6cdc2f5e3e.zip chromium_src-a21767477fef894a75d0b13a8da3da6cdc2f5e3e.tar.gz chromium_src-a21767477fef894a75d0b13a8da3da6cdc2f5e3e.tar.bz2 |
Foundations for Print Preview and Setup
Create the foundations of implementing a tab for printing should be in the form of:
print:http://www.google.com
I have followed similar approach as what has been done with view-source: and chrome-extension:
BUG=173, 947
TEST=none
Review URL: http://codereview.chromium.org/150207
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_security_policy.cc')
-rw-r--r-- | chrome/browser/child_process_security_policy.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/chrome/browser/child_process_security_policy.cc b/chrome/browser/child_process_security_policy.cc index b386e8e..b3ba538 100644 --- a/chrome/browser/child_process_security_policy.cc +++ b/chrome/browser/child_process_security_policy.cc @@ -98,6 +98,7 @@ ChildProcessSecurityPolicy::ChildProcessSecurityPolicy() { RegisterPseudoScheme(chrome::kAboutScheme); RegisterPseudoScheme(chrome::kJavaScriptScheme); RegisterPseudoScheme(chrome::kViewSourceScheme); + RegisterPseudoScheme(chrome::kPrintScheme); } ChildProcessSecurityPolicy::~ChildProcessSecurityPolicy() { @@ -170,10 +171,11 @@ void ChildProcessSecurityPolicy::GrantRequestURL(int renderer_id, const GURL& ur return; // The scheme has already been white-listed for every renderer. if (IsPseudoScheme(url.scheme())) { - // The view-source scheme is a special case of a pseudo URL that eventually - // results in requesting its embedded URL. - if (url.SchemeIs(chrome::kViewSourceScheme)) { - // URLs with the view-source scheme typically look like: + // The view-source and print schemes are a special case of a pseudo URL that + // eventually results in requesting its embedded URL. + if (url.SchemeIs(chrome::kViewSourceScheme) || + url.SchemeIs(chrome::kPrintScheme)) { + // URLs with the view-source and print schemes typically look like: // view-source:http://www.google.com/a // In order to request these URLs, the renderer needs to be able to // request the embedded URL. @@ -254,9 +256,10 @@ bool ChildProcessSecurityPolicy::CanRequestURL(int renderer_id, const GURL& url) if (IsPseudoScheme(url.scheme())) { // There are a number of special cases for pseudo schemes. - if (url.SchemeIs(chrome::kViewSourceScheme)) { - // A view-source URL is allowed if the renderer is permitted to request - // the embedded URL. + if (url.SchemeIs(chrome::kViewSourceScheme) || + url.SchemeIs(chrome::kPrintScheme)) { + // View-source and print URL's are allowed if the renderer is permitted + // to request the embedded URL. return CanRequestURL(renderer_id, GURL(url.path())); } |