summaryrefslogtreecommitdiffstats
path: root/chrome_frame/protocol_sink_wrap.cc
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 14:14:39 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 14:14:39 +0000
commitb57f0323eac5ecbbffd826abd92620901b55fd3a (patch)
treed907bb347a9aa2668213f27eee3eb257dbba41b3 /chrome_frame/protocol_sink_wrap.cc
parent543bcda1772cdd04e39fc8d912f61155ff570b9f (diff)
downloadchromium_src-b57f0323eac5ecbbffd826abd92620901b55fd3a.zip
chromium_src-b57f0323eac5ecbbffd826abd92620901b55fd3a.tar.gz
chromium_src-b57f0323eac5ecbbffd826abd92620901b55fd3a.tar.bz2
Enable developers to conditionally activate Chrome Frame, depending on the version of the host IE browser.
BUG=52601 TEST=[chrome_frame_unittests / UtilTests.XUaCompatibleDirectiveTest], [chrome_frame_tests / HeaderTest.*] Review URL: http://codereview.chromium.org/3978001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63728 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/protocol_sink_wrap.cc')
-rw-r--r--chrome_frame/protocol_sink_wrap.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome_frame/protocol_sink_wrap.cc b/chrome_frame/protocol_sink_wrap.cc
index 7e3a760..bb47a5d 100644
--- a/chrome_frame/protocol_sink_wrap.cc
+++ b/chrome_frame/protocol_sink_wrap.cc
@@ -312,12 +312,13 @@ RendererType DetermineRendererTypeFromMetaData(
}
if (info) {
- char buffer[32] = "x-ua-compatible";
+ char buffer[512] = "x-ua-compatible";
DWORD len = sizeof(buffer);
DWORD flags = 0;
HRESULT hr = info->QueryInfo(HTTP_QUERY_CUSTOM, buffer, &len, &flags, NULL);
+
if (hr == S_OK && len > 0) {
- if (StrStrIA(buffer, "chrome=1")) {
+ if (CheckXUaCompatibleDirective(buffer, GetIEMajorVersion())) {
return RENDERER_TYPE_CHROME_RESPONSE_HEADER;
}
}
@@ -345,9 +346,12 @@ RendererType DetermineRendererType(void* buffer, DWORD size, bool last_chance) {
// browsers may handle this properly, we don't and will stop scanning
// for the XUACompat content value if we encounter one.
std::wstring xua_compat_content;
- UtilGetXUACompatContentValue(html_contents, &xua_compat_content);
- if (StrStrI(xua_compat_content.c_str(), kChromeContentPrefix)) {
- renderer_type = RENDERER_TYPE_CHROME_HTTP_EQUIV;
+ if (SUCCEEDED(UtilGetXUACompatContentValue(html_contents,
+ &xua_compat_content))) {
+ if (CheckXUaCompatibleDirective(WideToASCII(xua_compat_content),
+ GetIEMajorVersion())) {
+ renderer_type = RENDERER_TYPE_CHROME_HTTP_EQUIV;
+ }
}
return renderer_type;