| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome_frame/urlmon_bind_status_callback.h" | 5 #include "chrome_frame/urlmon_bind_status_callback.h" |
| 6 | 6 |
| 7 #include <shlguid.h> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 9 | 11 |
| 10 CFUrlmonBindStatusCallback::CFUrlmonBindStatusCallback() | 12 CFUrlmonBindStatusCallback::CFUrlmonBindStatusCallback() |
| 11 : only_buffer_(false), data_(new RequestData()) { | 13 : only_buffer_(false), data_(new RequestData()) { |
| 12 DLOG(INFO) << __FUNCTION__ << me(); | 14 DLOG(INFO) << __FUNCTION__ << me(); |
| 13 } | 15 } |
| 14 | 16 |
| 15 CFUrlmonBindStatusCallback::~CFUrlmonBindStatusCallback() { | 17 CFUrlmonBindStatusCallback::~CFUrlmonBindStatusCallback() { |
| 16 DLOG(INFO) << __FUNCTION__ << me(); | 18 DLOG(INFO) << __FUNCTION__ << me(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 size_t bytes_read = 0; | 185 size_t bytes_read = 0; |
| 184 if (!only_buffer_) { | 186 if (!only_buffer_) { |
| 185 hr = data_->DelegateDataRead(delegate_, bscf, size, format_etc, stgmed, | 187 hr = data_->DelegateDataRead(delegate_, bscf, size, format_etc, stgmed, |
| 186 &bytes_read); | 188 &bytes_read); |
| 187 } | 189 } |
| 188 | 190 |
| 189 DLOG(INFO) << __FUNCTION__ << StringPrintf(" - 0x%08x", hr); | 191 DLOG(INFO) << __FUNCTION__ << StringPrintf(" - 0x%08x", hr); |
| 190 if (hr == INET_E_TERMINATED_BIND) { | 192 if (hr == INET_E_TERMINATED_BIND) { |
| 191 // Check if the content type is CF's mime type. | 193 // Check if the content type is CF's mime type. |
| 192 UINT cf_format = ::RegisterClipboardFormatW(kChromeMimeType); | 194 UINT cf_format = ::RegisterClipboardFormatW(kChromeMimeType); |
| 193 if (format_etc->cfFormat == cf_format) { | 195 bool override_bind_results = (format_etc->cfFormat == cf_format); |
| 196 if (!override_bind_results) { |
| 197 ScopedComPtr<IBrowserService> browser_service; |
| 198 DoQueryService(SID_SShellBrowser, delegate_, browser_service.Receive()); |
| 199 override_bind_results = (browser_service != NULL) && |
| 200 CheckForCFNavigation(browser_service, false); |
| 201 } |
| 202 |
| 203 if (override_bind_results) { |
| 194 // We want to complete fetching the entire document even though the | 204 // We want to complete fetching the entire document even though the |
| 195 // delegate isn't interested in continuing. | 205 // delegate isn't interested in continuing. |
| 196 // This happens when we switch from mshtml to CF. | 206 // This happens when we switch from mshtml to CF. |
| 197 // We take over and buffer the document and once we're done, we report | 207 // We take over and buffer the document and once we're done, we report |
| 198 // INET_E_TERMINATED to mshtml so that it will continue as usual. | 208 // INET_E_TERMINATED to mshtml so that it will continue as usual. |
| 199 hr = S_OK; | 209 hr = S_OK; |
| 200 only_buffer_ = true; | 210 only_buffer_ = true; |
| 201 binding_delegate_->OverrideBindResults(INET_E_TERMINATED_BIND); | 211 binding_delegate_->OverrideBindResults(INET_E_TERMINATED_BIND); |
| 202 } | 212 } |
| 203 } | 213 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 reserved); | 292 reserved); |
| 283 } | 293 } |
| 284 | 294 |
| 285 HRESULT CFUrlmonBindStatusCallback::GetSerializedClientCertContext( | 295 HRESULT CFUrlmonBindStatusCallback::GetSerializedClientCertContext( |
| 286 BYTE** cert, | 296 BYTE** cert, |
| 287 DWORD* cert_size) { | 297 DWORD* cert_size) { |
| 288 ScopedComPtr<IHttpNegotiate3> http_negotiate; | 298 ScopedComPtr<IHttpNegotiate3> http_negotiate; |
| 289 http_negotiate.QueryFrom(delegate_); | 299 http_negotiate.QueryFrom(delegate_); |
| 290 return http_negotiate->GetSerializedClientCertContext(cert, cert_size); | 300 return http_negotiate->GetSerializedClientCertContext(cert, cert_size); |
| 291 } | 301 } |
| OLD | NEW |