Chromium Code Reviews| 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_) { |