| 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/chrome_frame_activex.h" | 5 #include "chrome_frame/chrome_frame_activex.h" |
| 6 | 6 |
| 7 #include <wininet.h> | 7 #include <wininet.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 arraysize(bho_class_id_as_string)); | 675 arraysize(bho_class_id_as_string)); |
| 676 | 676 |
| 677 ScopedComPtr<IObjectWithSite> bho; | 677 ScopedComPtr<IObjectWithSite> bho; |
| 678 hr = bho.CreateInstance(CLSID_ChromeFrameBHO, NULL, CLSCTX_INPROC_SERVER); | 678 hr = bho.CreateInstance(CLSID_ChromeFrameBHO, NULL, CLSCTX_INPROC_SERVER); |
| 679 if (FAILED(hr)) { | 679 if (FAILED(hr)) { |
| 680 NOTREACHED() << "Failed to register ChromeFrame BHO. Error:" | 680 NOTREACHED() << "Failed to register ChromeFrame BHO. Error:" |
| 681 << base::StringPrintf(" 0x%08X", hr); | 681 << base::StringPrintf(" 0x%08X", hr); |
| 682 return hr; | 682 return hr; |
| 683 } | 683 } |
| 684 | 684 |
| 685 hr = UrlMkSetSessionOption(URLMON_OPTION_USERAGENT_REFRESH, NULL, 0, 0); |
| 686 if (FAILED(hr)) { |
| 687 DLOG(ERROR) << "Failed to refresh user agent string from registry. " |
| 688 << "UrlMkSetSessionOption returned " |
| 689 << base::StringPrintf("0x%08x", hr); |
| 690 return hr; |
| 691 } |
| 692 |
| 685 hr = bho->SetSite(web_browser2); | 693 hr = bho->SetSite(web_browser2); |
| 686 if (FAILED(hr)) { | 694 if (FAILED(hr)) { |
| 687 NOTREACHED() << "ChromeFrame BHO SetSite failed. Error:" | 695 NOTREACHED() << "ChromeFrame BHO SetSite failed. Error:" |
| 688 << base::StringPrintf(" 0x%08X", hr); | 696 << base::StringPrintf(" 0x%08X", hr); |
| 689 return hr; | 697 return hr; |
| 690 } | 698 } |
| 691 | 699 |
| 692 web_browser2->PutProperty(base::win::ScopedBstr(bho_class_id_as_string), | 700 web_browser2->PutProperty(base::win::ScopedBstr(bho_class_id_as_string), |
| 693 base::win::ScopedVariant(bho)); | 701 base::win::ScopedVariant(bho)); |
| 694 | 702 return S_OK; |
| 695 hr = UrlMkSetSessionOption(URLMON_OPTION_USERAGENT_REFRESH, NULL, 0, 0); | |
| 696 if (FAILED(hr)) { | |
| 697 DLOG(ERROR) << "Failed to refresh user agent string from registry. " | |
| 698 << "UrlMkSetSessionOption returned " | |
| 699 << base::StringPrintf("0x%08x", hr); | |
| 700 } | |
| 701 return hr; | |
| 702 } | 703 } |
| OLD | NEW |