Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
|
grt (UTC plus 2)
2011/05/25 16:10:07
2011
robertshield
2011/05/26 15:14:28
Copyright year nits.. grumble.. :)
| |
| 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/bho_loader.h" | 5 #include "chrome_frame/bho_loader.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlcomcli.h> | 8 #include <atlcomcli.h> |
| 9 #include <exdisp.h> | 9 #include <exdisp.h> |
| 10 | 10 |
| 11 #include "chrome_frame/chrome_frame_helper_util.h" | 11 #include "chrome_frame/chrome_frame_helper_util.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 } | 64 } |
| 65 | 65 |
| 66 if (browser_hwnd != NULL) { | 66 if (browser_hwnd != NULL) { |
| 67 // Step 3: | 67 // Step 3: |
| 68 // Parent window of status bar window is the web browser window. Try to | 68 // Parent window of status bar window is the web browser window. Try to |
| 69 // get its IWebBrowser2 interface | 69 // get its IWebBrowser2 interface |
| 70 CComPtr<IWebBrowser2> browser; | 70 CComPtr<IWebBrowser2> browser; |
| 71 UtilGetWebBrowserObjectFromWindow(browser_hwnd, __uuidof(browser), | 71 UtilGetWebBrowserObjectFromWindow(browser_hwnd, __uuidof(browser), |
| 72 reinterpret_cast<void**>(&browser)); | 72 reinterpret_cast<void**>(&browser)); |
| 73 if (browser) { | 73 if (browser) { |
| 74 | |
| 75 if (IsSystemLevelChromeFrameInstalled()) { | |
| 76 // We're in the right place, but a system-level installation has | |
| 77 // appeared. We should leave now. | |
| 78 return; | |
| 79 } | |
| 80 | |
| 74 // Figure out if we're already in the property map. | 81 // Figure out if we're already in the property map. |
| 75 wchar_t bho_clsid_as_string[MAX_PATH] = {0}; | 82 wchar_t bho_clsid_as_string[MAX_PATH] = {0}; |
| 76 StringFromGUID2(CLSID_ChromeFrameBHO, bho_clsid_as_string, | 83 StringFromGUID2(CLSID_ChromeFrameBHO, bho_clsid_as_string, |
| 77 ARRAYSIZE(bho_clsid_as_string)); | 84 ARRAYSIZE(bho_clsid_as_string)); |
| 78 CComBSTR bho_clsid_as_string_bstr(bho_clsid_as_string); | 85 CComBSTR bho_clsid_as_string_bstr(bho_clsid_as_string); |
| 79 | 86 |
| 80 CComVariant existing_bho; | 87 CComVariant existing_bho; |
| 81 HRESULT hr = browser->GetProperty(bho_clsid_as_string_bstr, | 88 HRESULT hr = browser->GetProperty(bho_clsid_as_string_bstr, |
| 82 &existing_bho); | 89 &existing_bho); |
| 83 | 90 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 } | 124 } |
| 118 | 125 |
| 119 void BHOLoader::StopHook() { | 126 void BHOLoader::StopHook() { |
| 120 hooker_->StopHook(); | 127 hooker_->StopHook(); |
| 121 } | 128 } |
| 122 | 129 |
| 123 BHOLoader* BHOLoader::GetInstance() { | 130 BHOLoader* BHOLoader::GetInstance() { |
| 124 static BHOLoader loader; | 131 static BHOLoader loader; |
| 125 return &loader; | 132 return &loader; |
| 126 } | 133 } |
| OLD | NEW |