Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3012)

Unified Diff: chrome_frame/urlmon_bind_status_callback.cc

Issue 976007: Don't assume that the mime type for documents that mshtml rejects is CF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome_frame/urlmon_moniker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/urlmon_bind_status_callback.cc
===================================================================
--- chrome_frame/urlmon_bind_status_callback.cc (revision 42653)
+++ chrome_frame/urlmon_bind_status_callback.cc (working copy)
@@ -160,6 +160,7 @@
HRESULT CFUrlmonBindStatusCallback::OnDataAvailable(DWORD bscf, DWORD size,
FORMATETC* format_etc,
STGMEDIUM* stgmed) {
+ DCHECK(format_etc);
#ifndef NDEBUG
wchar_t clip_fmt_name[MAX_PATH] = {0};
if (format_etc) {
@@ -187,14 +188,22 @@
DLOG(INFO) << __FUNCTION__ << StringPrintf(" - 0x%08x", hr);
if (hr == INET_E_TERMINATED_BIND) {
- // We want to complete fetching the entire document even though the
- // delegate isn't interested in continuing.
- // This happens when we switch from mshtml to CF.
- // We take over and buffer the document and once we're done, we report
- // INET_E_TERMINATED to mshtml so that it will continue as usual.
- hr = S_OK;
- only_buffer_ = true;
- binding_delegate_->OverrideBindResults(INET_E_TERMINATED_BIND);
+ // Check if the content type is CF's mime type.
+ wchar_t format_name[MAX_PATH] = {0};
+ ::GetClipboardFormatNameW(format_etc->cfFormat, format_name,
amit 2010/03/26 00:13:23 nit: would it be better to compare the return valu
+ arraysize(format_name));
+ DLOG(INFO) << StringPrintf("INET_E_TERMINATED_BIND for cf=%ls",
+ format_name);
+ if (lstrcmpiW(format_name, kChromeMimeType) == 0) {
+ // We want to complete fetching the entire document even though the
+ // delegate isn't interested in continuing.
+ // This happens when we switch from mshtml to CF.
+ // We take over and buffer the document and once we're done, we report
+ // INET_E_TERMINATED to mshtml so that it will continue as usual.
+ hr = S_OK;
+ only_buffer_ = true;
+ binding_delegate_->OverrideBindResults(INET_E_TERMINATED_BIND);
+ }
}
if (only_buffer_) {
« no previous file with comments | « no previous file | chrome_frame/urlmon_moniker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698