diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-17 04:48:37 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-17 04:48:37 +0000 |
commit | 3f55e8712f88d8477d9e58f68958e83c92664389 (patch) | |
tree | 21f9eeeda041fd570c31d8b0f266f780b767418f /chrome_frame/http_negotiate.h | |
parent | cd1c89e833b7e67b7a7ca8799122e07b65999771 (diff) | |
download | chromium_src-3f55e8712f88d8477d9e58f68958e83c92664389.zip chromium_src-3f55e8712f88d8477d9e58f68958e83c92664389.tar.gz chromium_src-3f55e8712f88d8477d9e58f68958e83c92664389.tar.bz2 |
Add the chromeframe tag to the user agent header at runtime instead of statically in the registry.TEST=Try disabling GCF and see if the chromeframe tag in the user agent is still set. It should not be. Also make sure you don't have an older version installed... the chromeframe tag should not be in the registry - if it is, you've got an older version still registered. This should fix the issue with going to wave.google.com after disabling chrome frame and seeing the white page of death.R=amitBUG=22760
Review URL: http://codereview.chromium.org/259025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/http_negotiate.h')
-rw-r--r-- | chrome_frame/http_negotiate.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/chrome_frame/http_negotiate.h b/chrome_frame/http_negotiate.h new file mode 100644 index 0000000..4a22d9c --- /dev/null +++ b/chrome_frame/http_negotiate.h @@ -0,0 +1,47 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_FRAME_HTTP_NEGOTIATE_H_ +#define CHROME_FRAME_HTTP_NEGOTIATE_H_ + +#include <urlmon.h> + +#include "base/basictypes.h" + +// Typedefs for IHttpNegotiate methods. +typedef HRESULT (STDMETHODCALLTYPE* IHttpNegotiate_BeginningTransaction_Fn)( + IHttpNegotiate* me, LPCWSTR url, LPCWSTR headers, DWORD reserved, + LPWSTR* additional_headers); +typedef HRESULT (STDMETHODCALLTYPE* IHttpNegotiate_OnResponse_Fn)( + IHttpNegotiate* me, DWORD response_code, LPCWSTR response_header, + LPCWSTR request_header, LPWSTR* additional_request_headers); + +// Patches methods of urlmon's IHttpNegotiate implementation for the purposes +// of adding to the http user agent header. +class HttpNegotiatePatch { + // class is not to be instantiated atm. + HttpNegotiatePatch(); + ~HttpNegotiatePatch(); + + public: + static bool Initialize(); + static void Uninitialize(); + + static STDMETHODIMP BeginningTransaction( + IHttpNegotiate_BeginningTransaction_Fn original, IHttpNegotiate* me, + LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR* additional_headers); + + static STDMETHODIMP OnResponse( + IHttpNegotiate_OnResponse_Fn original, IHttpNegotiate* me, + DWORD response_code, LPCWSTR response_header, LPCWSTR request_header, + LPWSTR* additional_request_headers); + + protected: + static HRESULT PatchHttpNegotiate(IUnknown* to_patch); + + private: + DISALLOW_COPY_AND_ASSIGN(HttpNegotiatePatch); +}; + +#endif // CHROME_FRAME_HTTP_NEGOTIATE_H_ |