| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // chrome_tab.cc : Implementation of DLL Exports. | 5 // chrome_tab.cc : Implementation of DLL Exports. |
| 6 | 6 |
| 7 // Need to include this before the ATL headers below. | 7 // Need to include this before the ATL headers below. |
| 8 #include "chrome_frame/chrome_tab.h" | 8 #include "chrome_frame/chrome_tab.h" |
| 9 | 9 |
| 10 #include <atlsecurity.h> | 10 #include <atlsecurity.h> |
| 11 #include <objbase.h> | 11 #include <objbase.h> |
| 12 | 12 |
| 13 #include "base/at_exit.h" | 13 #include "base/at_exit.h" |
| 14 #include "base/basictypes.h" |
| 14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 15 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 16 #include "base/file_version_info.h" | 17 #include "base/file_version_info.h" |
| 17 #include "base/logging.h" | 18 #include "base/logging.h" |
| 18 #include "base/logging_win.h" | 19 #include "base/logging_win.h" |
| 19 #include "base/metrics/field_trial.h" | 20 #include "base/metrics/field_trial.h" |
| 20 #include "base/path_service.h" | 21 #include "base/path_service.h" |
| 21 #include "base/string16.h" | 22 #include "base/string16.h" |
| 22 #include "base/string_number_conversions.h" | 23 #include "base/string_number_conversions.h" |
| 23 #include "base/string_piece.h" | 24 #include "base/string_piece.h" |
| 24 #include "base/string_util.h" | 25 #include "base/string_util.h" |
| 25 #include "base/sys_string_conversions.h" | 26 #include "base/sys_string_conversions.h" |
| 26 #include "base/utf_string_conversions.h" | 27 #include "base/utf_string_conversions.h" |
| 27 #include "base/win/registry.h" | 28 #include "base/win/registry.h" |
| 28 #include "base/win/windows_version.h" | 29 #include "base/win/windows_version.h" |
| 29 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
| 30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/metrics/entropy_provider.h" | 32 #include "chrome/common/metrics/entropy_provider.h" |
| 32 #include "chrome/installer/util/google_update_settings.h" | 33 #include "chrome/installer/util/google_update_settings.h" |
| 33 #include "chrome_frame/bho.h" | 34 #include "chrome_frame/bho.h" |
| 34 #include "chrome_frame/chrome_active_document.h" | 35 #include "chrome_frame/chrome_active_document.h" |
| 35 #include "chrome_frame/chrome_frame_activex.h" | 36 #include "chrome_frame/chrome_frame_activex.h" |
| 36 #include "chrome_frame/chrome_frame_automation.h" | 37 #include "chrome_frame/chrome_frame_automation.h" |
| 37 #include "chrome_frame/chrome_frame_reporting.h" | 38 #include "chrome_frame/chrome_frame_reporting.h" |
| 38 #include "chrome_frame/chrome_launcher_utils.h" | 39 #include "chrome_frame/chrome_launcher_utils.h" |
| 39 #include "chrome_frame/chrome_protocol.h" | 40 #include "chrome_frame/chrome_protocol.h" |
| 40 #include "chrome_frame/dll_redirector.h" | 41 #include "chrome_frame/dll_redirector.h" |
| 41 #include "chrome_frame/exception_barrier.h" | 42 #include "chrome_frame/exception_barrier.h" |
| 42 #include "chrome_frame/metrics_service.h" | 43 #include "chrome_frame/metrics_service.h" |
| 44 #include "chrome_frame/pin_module.h" |
| 43 #include "chrome_frame/resource.h" | 45 #include "chrome_frame/resource.h" |
| 44 #include "chrome_frame/utils.h" | 46 #include "chrome_frame/utils.h" |
| 45 #include "googleurl/src/url_util.h" | 47 #include "googleurl/src/url_util.h" |
| 46 #include "grit/chrome_frame_resources.h" | 48 #include "grit/chrome_frame_resources.h" |
| 47 | 49 |
| 48 using base::win::RegKey; | 50 using base::win::RegKey; |
| 49 | 51 |
| 50 namespace { | 52 namespace { |
| 51 // This function has the side effect of initializing an unprotected | |
| 52 // vector pointer inside GoogleUrl. If this is called during DLL loading, | |
| 53 // it has the effect of avoiding an initialization race on that pointer. | |
| 54 // TODO(siggi): fix GoogleUrl. | |
| 55 void InitGoogleUrl() { | |
| 56 static const char kDummyUrl[] = "http://www.google.com"; | |
| 57 | |
| 58 url_util::IsStandard(kDummyUrl, | |
| 59 url_parse::MakeRange(0, arraysize(kDummyUrl))); | |
| 60 } | |
| 61 | 53 |
| 62 const wchar_t kInternetSettings[] = | 54 const wchar_t kInternetSettings[] = |
| 63 L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; | 55 L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; |
| 64 | 56 |
| 65 const wchar_t kProtocolHandlers[] = | 57 const wchar_t kProtocolHandlers[] = |
| 66 L"Software\\Classes\\Protocols\\Handler"; | 58 L"Software\\Classes\\Protocols\\Handler"; |
| 67 | 59 |
| 68 const wchar_t kRunOnce[] = | 60 const wchar_t kRunOnce[] = |
| 69 L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce"; | 61 L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce"; |
| 70 | 62 |
| 71 const wchar_t kRunKeyName[] = L"ChromeFrameHelper"; | 63 const wchar_t kRunKeyName[] = L"ChromeFrameHelper"; |
| 72 | 64 |
| 73 const wchar_t kChromeFrameHelperExe[] = L"chrome_frame_helper.exe"; | 65 const wchar_t kChromeFrameHelperExe[] = L"chrome_frame_helper.exe"; |
| 74 const wchar_t kChromeFrameHelperStartupArg[] = L"--startup"; | 66 const wchar_t kChromeFrameHelperStartupArg[] = L"--startup"; |
| 75 | 67 |
| 76 // Window class and window names. | 68 // Window class and window names. |
| 77 // TODO(robertshield): These and other constants need to be refactored into | 69 // TODO(robertshield): These and other constants need to be refactored into |
| 78 // a common chrome_frame_constants.h|cc and built into a separate lib | 70 // a common chrome_frame_constants.h|cc and built into a separate lib |
| 79 // (either chrome_frame_utils or make another one). | 71 // (either chrome_frame_utils or make another one). |
| 80 const wchar_t kChromeFrameHelperWindowClassName[] = | 72 const wchar_t kChromeFrameHelperWindowClassName[] = |
| 81 L"ChromeFrameHelperWindowClass"; | 73 L"ChromeFrameHelperWindowClass"; |
| 82 const wchar_t kChromeFrameHelperWindowName[] = | 74 const wchar_t kChromeFrameHelperWindowName[] = |
| 83 L"ChromeFrameHelperWindowName"; | 75 L"ChromeFrameHelperWindowName"; |
| 84 | 76 |
| 85 // {0562BFC3-2550-45b4-BD8E-A310583D3A6F} | 77 // {0562BFC3-2550-45b4-BD8E-A310583D3A6F} |
| 86 static const GUID kChromeFrameProvider = | 78 const GUID kChromeFrameProvider = |
| 87 { 0x562bfc3, 0x2550, 0x45b4, | 79 { 0x562bfc3, 0x2550, 0x45b4, |
| 88 { 0xbd, 0x8e, 0xa3, 0x10, 0x58, 0x3d, 0x3a, 0x6f } }; | 80 { 0xbd, 0x8e, 0xa3, 0x10, 0x58, 0x3d, 0x3a, 0x6f } }; |
| 89 | 81 |
| 90 const wchar_t kPostPlatformUAKey[] = | 82 const wchar_t kPostPlatformUAKey[] = |
| 91 L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\" | 83 L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\" |
| 92 L"User Agent\\Post Platform"; | 84 L"User Agent\\Post Platform"; |
| 93 const wchar_t kChromeFramePrefix[] = L"chromeframe/"; | 85 const wchar_t kChromeFramePrefix[] = L"chromeframe/"; |
| 94 | 86 |
| 95 // See comments in DllGetClassObject. | 87 // See comments in DllGetClassObject. |
| 96 LPFNGETCLASSOBJECT g_dll_get_class_object_redir_ptr = NULL; | 88 LPFNGETCLASSOBJECT g_dll_get_class_object_redir_ptr = NULL; |
| 97 | 89 |
| 90 // This function has the side effect of initializing an unprotected |
| 91 // vector pointer inside GoogleUrl. If this is called during DLL loading, |
| 92 // it has the effect of avoiding an initialization race on that pointer. |
| 93 // TODO(siggi): fix GoogleUrl. |
| 94 void InitGoogleUrl() { |
| 95 static const char kDummyUrl[] = "http://www.google.com"; |
| 96 |
| 97 url_util::IsStandard(kDummyUrl, |
| 98 url_parse::MakeRange(0, arraysize(kDummyUrl))); |
| 99 } |
| 100 |
| 98 class ChromeTabModule : public CAtlDllModuleT<ChromeTabModule> { | 101 class ChromeTabModule : public CAtlDllModuleT<ChromeTabModule> { |
| 99 public: | 102 public: |
| 100 typedef CAtlDllModuleT<ChromeTabModule> ParentClass; | 103 typedef CAtlDllModuleT<ChromeTabModule> ParentClass; |
| 101 | 104 |
| 102 ChromeTabModule() : do_system_registration_(true) {} | 105 ChromeTabModule() : do_system_registration_(true), crash_reporting_(NULL) {} |
| 103 | 106 |
| 104 DECLARE_LIBID(LIBID_ChromeTabLib) | 107 DECLARE_LIBID(LIBID_ChromeTabLib) |
| 105 DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CHROMETAB, | 108 DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CHROMETAB, |
| 106 "{FD9B1B31-F4D8-436A-8F4F-D3C2E36733D3}") | 109 "{FD9B1B31-F4D8-436A-8F4F-D3C2E36733D3}") |
| 107 | 110 |
| 108 // Override to add our SYSTIME binary value to registry scripts. | 111 // Override to add our SYSTIME binary value to registry scripts. |
| 109 // See chrome_frame_activex.rgs for usage. | 112 // See chrome_frame_activex.rgs for usage. |
| 110 virtual HRESULT AddCommonRGSReplacements(IRegistrarBase* registrar) throw() { | 113 virtual HRESULT AddCommonRGSReplacements(IRegistrarBase* registrar) throw() { |
| 111 HRESULT hr = ParentClass::AddCommonRGSReplacements(registrar); | 114 HRESULT hr = ParentClass::AddCommonRGSReplacements(registrar); |
| 112 | 115 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (SUCCEEDED(hr)) { | 185 if (SUCCEEDED(hr)) { |
| 183 // Add the Chrome Frame CLSID. | 186 // Add the Chrome Frame CLSID. |
| 184 wchar_t cf_clsid[64]; | 187 wchar_t cf_clsid[64]; |
| 185 StringFromGUID2(CLSID_ChromeFrame, &cf_clsid[0], arraysize(cf_clsid)); | 188 StringFromGUID2(CLSID_ChromeFrame, &cf_clsid[0], arraysize(cf_clsid)); |
| 186 hr = registrar->AddReplacement(L"CHROME_FRAME_CLSID", &cf_clsid[0]); | 189 hr = registrar->AddReplacement(L"CHROME_FRAME_CLSID", &cf_clsid[0]); |
| 187 } | 190 } |
| 188 | 191 |
| 189 return hr; | 192 return hr; |
| 190 } | 193 } |
| 191 | 194 |
| 195 // The module is "locked" when an object takes a reference on it. The first |
| 196 // time it is locked, take a reference on crash reporting to bind its lifetime |
| 197 // to the module. |
| 198 virtual LONG Lock() throw() { |
| 199 LONG result = ParentClass::Lock(); |
| 200 if (result == 1) { |
| 201 DCHECK_EQ(crash_reporting_, |
| 202 static_cast<chrome_frame::ScopedCrashReporting*>(NULL)); |
| 203 crash_reporting_ = new chrome_frame::ScopedCrashReporting(); |
| 204 } |
| 205 return result; |
| 206 } |
| 207 |
| 208 // The module is "unlocked" when an object that had a reference on it is |
| 209 // destroyed. The last time it is unlocked, release the reference on crash |
| 210 // reporting. |
| 211 virtual LONG Unlock() throw() { |
| 212 LONG result = ParentClass::Unlock(); |
| 213 if (!result) { |
| 214 DCHECK_NE(crash_reporting_, |
| 215 static_cast<chrome_frame::ScopedCrashReporting*>(NULL)); |
| 216 delete crash_reporting_; |
| 217 crash_reporting_ = NULL; |
| 218 } |
| 219 return result; |
| 220 } |
| 221 |
| 192 // See comments in AddCommonRGSReplacements | 222 // See comments in AddCommonRGSReplacements |
| 193 bool do_system_registration_; | 223 bool do_system_registration_; |
| 224 |
| 225 private: |
| 226 // A scoper created when the module is initially locked and destroyed when it |
| 227 // is finally unlocked. This is not a scoped_ptr since that could cause |
| 228 // reporting to shut down at exit, which would lead to problems with the |
| 229 // loader lock. |
| 230 chrome_frame::ScopedCrashReporting* crash_reporting_; |
| 194 }; | 231 }; |
| 195 | 232 |
| 196 ChromeTabModule _AtlModule; | 233 ChromeTabModule _AtlModule; |
| 197 | 234 |
| 198 base::AtExitManager* g_exit_manager = NULL; | 235 base::AtExitManager* g_exit_manager = NULL; |
| 199 base::FieldTrialList* g_field_trial_list = NULL; | 236 base::FieldTrialList* g_field_trial_list = NULL; |
| 200 | 237 |
| 201 HRESULT RefreshElevationPolicy() { | 238 HRESULT RefreshElevationPolicy() { |
| 202 const wchar_t kIEFrameDll[] = L"ieframe.dll"; | 239 const wchar_t kIEFrameDll[] = L"ieframe.dll"; |
| 203 const char kIERefreshPolicy[] = "IERefreshElevationPolicy"; | 240 const char kIERefreshPolicy[] = "IERefreshElevationPolicy"; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 result2 = key.WriteValue(L"ChromeTab.ChromeActiveDocument.1", 1); | 578 result2 = key.WriteValue(L"ChromeTab.ChromeActiveDocument.1", 1); |
| 542 } else { | 579 } else { |
| 543 result1 = key.DeleteValue(L"ChromeTab.ChromeActiveDocument"); | 580 result1 = key.DeleteValue(L"ChromeTab.ChromeActiveDocument"); |
| 544 result2 = key.DeleteValue(L"ChromeTab.ChromeActiveDocument.1"); | 581 result2 = key.DeleteValue(L"ChromeTab.ChromeActiveDocument.1"); |
| 545 } | 582 } |
| 546 | 583 |
| 547 return result1 != ERROR_SUCCESS ? HRESULT_FROM_WIN32(result1) : | 584 return result1 != ERROR_SUCCESS ? HRESULT_FROM_WIN32(result1) : |
| 548 HRESULT_FROM_WIN32(result2); | 585 HRESULT_FROM_WIN32(result2); |
| 549 } | 586 } |
| 550 | 587 |
| 588 void OnPinModule() { |
| 589 // Pin crash reporting by leaking a reference. |
| 590 ignore_result(new chrome_frame::ScopedCrashReporting()); |
| 591 } |
| 592 |
| 551 // Chrome Frame registration functions. | 593 // Chrome Frame registration functions. |
| 552 //----------------------------------------------------------------------------- | 594 //----------------------------------------------------------------------------- |
| 553 HRESULT RegisterSecuredMimeHandler(bool enable, bool is_system) { | 595 HRESULT RegisterSecuredMimeHandler(bool enable, bool is_system) { |
| 554 if (!is_system) { | 596 if (!is_system) { |
| 555 return SetOrDeleteMimeHandlerKey(enable, HKEY_CURRENT_USER); | 597 return SetOrDeleteMimeHandlerKey(enable, HKEY_CURRENT_USER); |
| 556 } else if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 598 } else if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| 557 return SetOrDeleteMimeHandlerKey(enable, HKEY_LOCAL_MACHINE); | 599 return SetOrDeleteMimeHandlerKey(enable, HKEY_LOCAL_MACHINE); |
| 558 } | 600 } |
| 559 | 601 |
| 560 std::wstring mime_key = kInternetSettings; | 602 std::wstring mime_key = kInternetSettings; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 if (reason == DLL_PROCESS_ATTACH) { | 864 if (reason == DLL_PROCESS_ATTACH) { |
| 823 #ifndef NDEBUG | 865 #ifndef NDEBUG |
| 824 // Silence traces from the ATL registrar to reduce the log noise. | 866 // Silence traces from the ATL registrar to reduce the log noise. |
| 825 ATL::CTrace::s_trace.ChangeCategory(atlTraceRegistrar, 0, | 867 ATL::CTrace::s_trace.ChangeCategory(atlTraceRegistrar, 0, |
| 826 ATLTRACESTATUS_DISABLED); | 868 ATLTRACESTATUS_DISABLED); |
| 827 #endif | 869 #endif |
| 828 InitGoogleUrl(); | 870 InitGoogleUrl(); |
| 829 | 871 |
| 830 g_exit_manager = new base::AtExitManager(); | 872 g_exit_manager = new base::AtExitManager(); |
| 831 CommandLine::Init(0, NULL); | 873 CommandLine::Init(0, NULL); |
| 832 InitializeCrashReporting(); | |
| 833 logging::InitLogging( | 874 logging::InitLogging( |
| 834 NULL, | 875 NULL, |
| 835 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 876 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
| 836 logging::LOCK_LOG_FILE, | 877 logging::LOCK_LOG_FILE, |
| 837 logging::DELETE_OLD_LOG_FILE, | 878 logging::DELETE_OLD_LOG_FILE, |
| 838 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 879 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
| 839 | 880 |
| 840 // Log the same items as Chrome. | 881 // Log the same items as Chrome. |
| 841 logging::SetLogItems(true, // enable_process_id | 882 logging::SetLogItems(true, // enable_process_id |
| 842 true, // enable_thread_id | 883 true, // enable_thread_id |
| (...skipping 12 matching lines...) Expand all Loading... |
| 855 << "Found CF module with no DllGetClassObject export."; | 896 << "Found CF module with no DllGetClassObject export."; |
| 856 } | 897 } |
| 857 | 898 |
| 858 // Enable trace control and transport through event tracing for Windows. | 899 // Enable trace control and transport through event tracing for Windows. |
| 859 logging::LogEventProvider::Initialize(kChromeFrameProvider); | 900 logging::LogEventProvider::Initialize(kChromeFrameProvider); |
| 860 | 901 |
| 861 // Initialize the field test infrastructure. Must be done somewhere that | 902 // Initialize the field test infrastructure. Must be done somewhere that |
| 862 // can only get called once. For Chrome Frame, that is here. | 903 // can only get called once. For Chrome Frame, that is here. |
| 863 g_field_trial_list = new base::FieldTrialList( | 904 g_field_trial_list = new base::FieldTrialList( |
| 864 new metrics::SHA1EntropyProvider(MetricsService::GetClientID())); | 905 new metrics::SHA1EntropyProvider(MetricsService::GetClientID())); |
| 906 |
| 907 // Set a callback so that crash reporting can be pinned when the module is |
| 908 // pinned. |
| 909 chrome_frame::SetPinModuleCallback(&OnPinModule); |
| 865 } else if (reason == DLL_PROCESS_DETACH) { | 910 } else if (reason == DLL_PROCESS_DETACH) { |
| 866 delete g_field_trial_list; | 911 delete g_field_trial_list; |
| 867 g_field_trial_list = NULL; | 912 g_field_trial_list = NULL; |
| 868 | 913 |
| 869 DllRedirector* dll_redirector = DllRedirector::GetInstance(); | 914 DllRedirector* dll_redirector = DllRedirector::GetInstance(); |
| 870 DCHECK(dll_redirector); | 915 DCHECK(dll_redirector); |
| 871 dll_redirector->UnregisterAsFirstCFModule(); | 916 dll_redirector->UnregisterAsFirstCFModule(); |
| 872 | 917 |
| 873 g_patch_helper.UnpatchIfNeeded(); | 918 g_patch_helper.UnpatchIfNeeded(); |
| 874 | 919 |
| 875 delete g_exit_manager; | 920 delete g_exit_manager; |
| 876 g_exit_manager = NULL; | 921 g_exit_manager = NULL; |
| 877 | |
| 878 ShutdownCrashReporting(); | |
| 879 } | 922 } |
| 880 return _AtlModule.DllMain(reason, reserved); | 923 return _AtlModule.DllMain(reason, reserved); |
| 881 } | 924 } |
| 882 | 925 |
| 883 // Used to determine whether the DLL can be unloaded by OLE | 926 // Used to determine whether the DLL can be unloaded by OLE |
| 884 STDAPI DllCanUnloadNow() { | 927 STDAPI DllCanUnloadNow() { |
| 885 return _AtlModule.DllCanUnloadNow(); | 928 return _AtlModule.DllCanUnloadNow(); |
| 886 } | 929 } |
| 887 | 930 |
| 888 // Returns a class factory to create an object of the requested type | 931 // Returns a class factory to create an object of the requested type |
| 889 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { | 932 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { |
| 933 chrome_frame::ScopedCrashReporting crash_reporting; |
| 934 |
| 890 // If we found another module present when we were loaded, then delegate to | 935 // If we found another module present when we were loaded, then delegate to |
| 891 // that: | 936 // that: |
| 892 if (g_dll_get_class_object_redir_ptr) { | 937 if (g_dll_get_class_object_redir_ptr) { |
| 893 return g_dll_get_class_object_redir_ptr(rclsid, riid, ppv); | 938 return g_dll_get_class_object_redir_ptr(rclsid, riid, ppv); |
| 894 } | 939 } |
| 895 | 940 |
| 896 // Enable sniffing and switching only if asked for BHO | 941 // Enable sniffing and switching only if asked for BHO |
| 897 // (we use BHO to get loaded in IE). | 942 // (we use BHO to get loaded in IE). |
| 898 if (rclsid == CLSID_ChromeFrameBHO) { | 943 if (rclsid == CLSID_ChromeFrameBHO) { |
| 899 g_patch_helper.InitializeAndPatchProtocolsIfNeeded(); | 944 g_patch_helper.InitializeAndPatchProtocolsIfNeeded(); |
| 900 } | 945 } |
| 901 | 946 |
| 902 return _AtlModule.DllGetClassObject(rclsid, riid, ppv); | 947 return _AtlModule.DllGetClassObject(rclsid, riid, ppv); |
| 903 } | 948 } |
| 904 | 949 |
| 905 // DllRegisterServer - Adds entries to the system registry | 950 // DllRegisterServer - Adds entries to the system registry |
| 906 STDAPI DllRegisterServer() { | 951 STDAPI DllRegisterServer() { |
| 952 chrome_frame::ScopedCrashReporting crash_reporting; |
| 907 uint16 flags = ACTIVEX | ACTIVEDOC | TYPELIB | GCF_PROTOCOL | | 953 uint16 flags = ACTIVEX | ACTIVEDOC | TYPELIB | GCF_PROTOCOL | |
| 908 BHO_CLSID | BHO_REGISTRATION; | 954 BHO_CLSID | BHO_REGISTRATION; |
| 909 | 955 |
| 910 HRESULT hr = CustomRegistration(flags, true, true); | 956 HRESULT hr = CustomRegistration(flags, true, true); |
| 911 if (SUCCEEDED(hr)) { | 957 if (SUCCEEDED(hr)) { |
| 912 SetupRunOnce(); | 958 SetupRunOnce(); |
| 913 } | 959 } |
| 914 | 960 |
| 915 return hr; | 961 return hr; |
| 916 } | 962 } |
| 917 | 963 |
| 918 // DllUnregisterServer - Removes entries from the system registry | 964 // DllUnregisterServer - Removes entries from the system registry |
| 919 STDAPI DllUnregisterServer() { | 965 STDAPI DllUnregisterServer() { |
| 966 chrome_frame::ScopedCrashReporting crash_reporting; |
| 920 HRESULT hr = CustomRegistration(ALL, false, true); | 967 HRESULT hr = CustomRegistration(ALL, false, true); |
| 921 return hr; | 968 return hr; |
| 922 } | 969 } |
| 923 | 970 |
| 924 // DllRegisterUserServer - Adds entries to the HKCU hive in the registry. | 971 // DllRegisterUserServer - Adds entries to the HKCU hive in the registry. |
| 925 STDAPI DllRegisterUserServer() { | 972 STDAPI DllRegisterUserServer() { |
| 973 chrome_frame::ScopedCrashReporting crash_reporting; |
| 926 UINT flags = ACTIVEX | ACTIVEDOC | TYPELIB | GCF_PROTOCOL | | 974 UINT flags = ACTIVEX | ACTIVEDOC | TYPELIB | GCF_PROTOCOL | |
| 927 BHO_CLSID | BHO_REGISTRATION; | 975 BHO_CLSID | BHO_REGISTRATION; |
| 928 | 976 |
| 929 HRESULT hr = CustomRegistration(flags, TRUE, false); | 977 HRESULT hr = CustomRegistration(flags, TRUE, false); |
| 930 if (SUCCEEDED(hr)) { | 978 if (SUCCEEDED(hr)) { |
| 931 SetupRunOnce(); | 979 SetupRunOnce(); |
| 932 } | 980 } |
| 933 | 981 |
| 934 return hr; | 982 return hr; |
| 935 } | 983 } |
| 936 | 984 |
| 937 // DllUnregisterUserServer - Removes entries from the HKCU hive in the registry. | 985 // DllUnregisterUserServer - Removes entries from the HKCU hive in the registry. |
| 938 STDAPI DllUnregisterUserServer() { | 986 STDAPI DllUnregisterUserServer() { |
| 987 chrome_frame::ScopedCrashReporting crash_reporting; |
| 939 HRESULT hr = CustomRegistration(ALL, FALSE, false); | 988 HRESULT hr = CustomRegistration(ALL, FALSE, false); |
| 940 return hr; | 989 return hr; |
| 941 } | 990 } |
| 942 | 991 |
| 943 // Object entries go here instead of with each object, so that we can move | 992 // Object entries go here instead of with each object, so that we can move |
| 944 // the objects to a lib. Also reduces magic. | 993 // the objects to a lib. Also reduces magic. |
| 945 OBJECT_ENTRY_AUTO(CLSID_ChromeFrameBHO, Bho) | 994 OBJECT_ENTRY_AUTO(CLSID_ChromeFrameBHO, Bho) |
| 946 OBJECT_ENTRY_AUTO(__uuidof(ChromeActiveDocument), ChromeActiveDocument) | 995 OBJECT_ENTRY_AUTO(__uuidof(ChromeActiveDocument), ChromeActiveDocument) |
| 947 OBJECT_ENTRY_AUTO(__uuidof(ChromeFrame), ChromeFrameActivex) | 996 OBJECT_ENTRY_AUTO(__uuidof(ChromeFrame), ChromeFrameActivex) |
| 948 OBJECT_ENTRY_AUTO(__uuidof(ChromeProtocol), ChromeProtocol) | 997 OBJECT_ENTRY_AUTO(__uuidof(ChromeProtocol), ChromeProtocol) |
| OLD | NEW |