diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:24:29 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:24:29 +0000 |
commit | 552fb601aa696cc69de9fbf69f17438ac1f6f3a9 (patch) | |
tree | 1b800a99dff7facce52bb5423a056a6e1ff4356a /chrome_frame/chrome_active_document.cc | |
parent | 9a30588cd1081b702ade98be4eb4a7c1344bb43e (diff) | |
download | chromium_src-552fb601aa696cc69de9fbf69f17438ac1f6f3a9.zip chromium_src-552fb601aa696cc69de9fbf69f17438ac1f6f3a9.tar.gz chromium_src-552fb601aa696cc69de9fbf69f17438ac1f6f3a9.tar.bz2 |
Remove cf: protocol
Well, almost. cf: is now changed to gcf: protocol. gcf: protocol
now is supported only for the following cases:
1. gcf:attach_external_tabXXX urls. These are URLs used internally
by Chrome Frame to implement window.open
2. gcf:about:xxx
3. gcf:view-source:xxx
4 For any other URLs ONLY if it is enabled by setting a registry
value 'EnableGCFProtocol' to 1 in HKCU\Software\Google\ChromeFrame
BUG=22721,23006,23175,29350
TEST=changed existing cf: tests to new gcf: tests, added a new test for cf:view-source
Review URL: http://codereview.chromium.org/562008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_active_document.cc')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 202128b..091f0ba 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -40,8 +40,7 @@ const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab"; static const wchar_t kUseChromeNetworking[] = L"UseChromeNetworking"; -static const wchar_t kHandleTopLevelRequests[] = - L"HandleTopLevelRequests"; +static const wchar_t kHandleTopLevelRequests[] = L"HandleTopLevelRequests"; DEFINE_GUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, 0x46); @@ -821,6 +820,20 @@ bool ChromeActiveDocument::ParseUrl(const std::wstring& url, return false; } + if (*is_chrome_protocol) { + // Allow chrome protocol (gcf:) if - + // - explicitly enabled using registry + // - for gcf:attach_external_tab + // - for gcf:about and gcf:view-source + GURL crack_url(initial_url); + bool allow_gcf_protocol = !*is_new_navigation || + GetConfigBool(false, kEnableGCFProtocol) || + crack_url.SchemeIs(chrome::kAboutScheme) || + crack_url.SchemeIs(chrome::kViewSourceScheme); + if (!allow_gcf_protocol) + return false; + } + *parsed_url = initial_url; return true; } |