summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_security_policy.cc
diff options
context:
space:
mode:
authortimsteele@google.com <timsteele@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 18:46:34 +0000
committertimsteele@google.com <timsteele@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 18:46:34 +0000
commit3a453fa1f16dfa4168e52790e329148366abb05f (patch)
treea8bbab89ec883a838600e0b63d92fad4361e5dfb /chrome/browser/renderer_security_policy.cc
parent173de1be12780200c62bae5c01965d51ac0eaa31 (diff)
downloadchromium_src-3a453fa1f16dfa4168e52790e329148366abb05f.zip
chromium_src-3a453fa1f16dfa4168e52790e329148366abb05f.tar.gz
chromium_src-3a453fa1f16dfa4168e52790e329148366abb05f.tar.bz2
Copy from http://chrome-reviews.prom.corp.google.com/1237 (new gcl changelist model).
Description was: Conditionally include personalization/ code by surrounding the hooks into this module with #ifdef CHROME_PERSONALIZATION in various .h/.cc files. Building with the module requires adding this macro as a preprocessor definition in build/internal/essential.vsprops, and adding it to the VCResourceCompiler tool's command line (using /d). We will try and make this easier in the future. TBR=darin git-svn-id: svn://svn.chromium.org/chrome/trunk/src@955 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_security_policy.cc')
-rw-r--r--chrome/browser/renderer_security_policy.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/renderer_security_policy.cc b/chrome/browser/renderer_security_policy.cc
index d4a8d965..91988da 100644
--- a/chrome/browser/renderer_security_policy.cc
+++ b/chrome/browser/renderer_security_policy.cc
@@ -31,6 +31,9 @@
#include "base/logging.h"
#include "base/string_util.h"
+#ifdef CHROME_PERSONALIZATION
+#include "chrome/personalization/personalization.h"
+#endif
#include "googleurl/src/gurl.h"
#include "net/url_request/url_request.h"
@@ -249,8 +252,8 @@ bool RendererSecurityPolicy::CanRequestURL(int renderer_id, const GURL& url) {
// There are a number of special cases for pseudo schemes.
if (url.SchemeIs("view-source")) {
- // A view-source URL is allowed if the renderer is permited to request the
- // embedded URL.
+ // A view-source URL is allowed if the renderer is permitted to request
+ // the embedded URL.
return CanRequestURL(renderer_id, GURL(url.path()));
}
@@ -263,6 +266,11 @@ bool RendererSecurityPolicy::CanRequestURL(int renderer_id, const GURL& url) {
return false;
}
+#ifdef CHROME_PERSONALIZATION
+ if (url.SchemeIs(kPersonalizationScheme))
+ return true;
+#endif
+
if (!URLRequest::IsHandledURL(url))
return true; // This URL request is destined for ShellExecute.