summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.h
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-11 19:31:56 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-11 19:31:56 +0000
commitb22ef28f215f7475f1c0401f89e353a8aacf8def (patch)
tree045041d0534fb9aa8b6b009e3a7499809b42e7ed /chrome_frame/utils.h
parent2f7aff273b0a1357e79d99e2f31ede1f702d8783 (diff)
downloadchromium_src-b22ef28f215f7475f1c0401f89e353a8aacf8def.zip
chromium_src-b22ef28f215f7475f1c0401f89e353a8aacf8def.tar.gz
chromium_src-b22ef28f215f7475f1c0401f89e353a8aacf8def.tar.bz2
Use the OnHttpEquiv notification to switch to CF when the http-equiv meta tag is detected. This implementation is still behind the registry switch (set PatchProtocols to 0 in the registry). I will switch over to it wholesale in a separate patch.
We use the same mechanism for re-initiating the navigation we use to transfer downloads over to the host, so I moved the common code to utils.cc and added NavigateBrowserToMoniker. When we see a browser instance attempting to load a CF document, we raise a TLS flag that we catch in HttpNegotiatePatch::ReportProgress when the mime type is being reported. This is the same place where we examine http headers and report the mime type. BUG=n/a TEST=Set PatchProtocols (REG_DWORD) to 0 in the CF HKCU config key and make sure we detect and handle the meta tag as well or better than before. Review URL: http://codereview.chromium.org/489004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.h')
-rw-r--r--chrome_frame/utils.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h
index f71bb7d..8750794 100644
--- a/chrome_frame/utils.h
+++ b/chrome_frame/utils.h
@@ -7,7 +7,8 @@
#include <atlbase.h>
#include <string>
-#include <UrlMon.h>
+#include <shdeprecated.h>
+#include <urlmon.h>
#include "base/basictypes.h"
#include "base/logging.h"
@@ -215,6 +216,19 @@ HRESULT DoQueryService(const IID& service_id, IUnknown* unk, T** service) {
HRESULT GetUrlFromMoniker(IMoniker* moniker, IBindCtx* bind_context,
std::wstring* url);
+// Navigates an IWebBrowser2 object to a moniker.
+HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker,
+ IBindCtx* bind_ctx);
+
+// Raises a flag on the current thread (using TLS) to indicate that an
+// in-progress navigation should be rendered in chrome frame.
+void MarkBrowserOnThreadForCFNavigation(IBrowserService* browser);
+
+// Checks if this browser instance has been marked as currently navigating
+// to a CF document. If clear_flag is set to true, the tls flag is cleared but
+// only if the browser has been marked.
+bool CheckForCFNavigation(IBrowserService* browser, bool clear_flag);
+
// Returns true if the URL passed in is something which can be handled by
// Chrome. If this function returns false then we should fail the navigation.
// When is_privileged is true, chrome extension URLs will be considered valid.