| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/at_exit.h" | 6 #include "base/at_exit.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/registry.h" | 12 #include "base/registry.h" |
| 13 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/sys_string_conversions.h" | 15 #include "base/sys_string_conversions.h" |
| 16 #include "base/win_util.h" | 16 #include "base/win_util.h" |
| 17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 18 #include "grit/chrome_frame_resources.h" | 18 #include "grit/chrome_frame_resources.h" |
| 19 #include "chrome_frame/bho.h" | 19 #include "chrome_frame/bho.h" |
| 20 #include "chrome_frame/chrome_frame_automation.h" | 20 #include "chrome_frame/chrome_frame_automation.h" |
| 21 #include "chrome_frame/chrome_frame_reporting.h" |
| 21 #include "chrome_frame/chrome_launcher.h" | 22 #include "chrome_frame/chrome_launcher.h" |
| 22 #include "chrome_frame/crash_report.h" | |
| 23 #include "chrome_frame/resource.h" | 23 #include "chrome_frame/resource.h" |
| 24 #include "chrome_frame/utils.h" | 24 #include "chrome_frame/utils.h" |
| 25 | 25 |
| 26 // Include without path to make GYP build see it. | 26 // Include without path to make GYP build see it. |
| 27 #include "chrome_tab.h" // NOLINT | 27 #include "chrome_tab.h" // NOLINT |
| 28 #include <atlsecurity.h> | 28 #include <atlsecurity.h> |
| 29 | 29 |
| 30 static const wchar_t kBhoRegistryPath[] = | 30 static const wchar_t kBhoRegistryPath[] = |
| 31 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" | 31 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" |
| 32 L"\\Browser Helper Objects"; | 32 L"\\Browser Helper Objects"; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 extern "C" BOOL WINAPI DllMain(HINSTANCE instance, | 117 extern "C" BOOL WINAPI DllMain(HINSTANCE instance, |
| 118 DWORD reason, | 118 DWORD reason, |
| 119 LPVOID reserved) { | 119 LPVOID reserved) { |
| 120 UNREFERENCED_PARAMETER(instance); | 120 UNREFERENCED_PARAMETER(instance); |
| 121 if (reason == DLL_PROCESS_ATTACH) { | 121 if (reason == DLL_PROCESS_ATTACH) { |
| 122 #ifndef NDEBUG | 122 #ifndef NDEBUG |
| 123 // Silence traces from the ATL registrar to reduce the log noise. | 123 // Silence traces from the ATL registrar to reduce the log noise. |
| 124 ATL::CTrace::s_trace.ChangeCategory(atlTraceRegistrar, 0, | 124 ATL::CTrace::s_trace.ChangeCategory(atlTraceRegistrar, 0, |
| 125 ATLTRACESTATUS_DISABLED); | 125 ATLTRACESTATUS_DISABLED); |
| 126 #endif | 126 #endif |
| 127 InitializeCrashReporting(false, false); | 127 InitializeCrashReporting(); |
| 128 g_exit_manager = new base::AtExitManager(); | 128 g_exit_manager = new base::AtExitManager(); |
| 129 CommandLine::Init(0, NULL); | 129 CommandLine::Init(0, NULL); |
| 130 logging::InitLogging(NULL, logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 130 logging::InitLogging(NULL, logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
| 131 logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE); | 131 logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE); |
| 132 } else if (reason == DLL_PROCESS_DETACH) { | 132 } else if (reason == DLL_PROCESS_DETACH) { |
| 133 g_patch_helper.UnpatchIfNeeded(); | 133 g_patch_helper.UnpatchIfNeeded(); |
| 134 delete g_exit_manager; | 134 delete g_exit_manager; |
| 135 g_exit_manager = NULL; | 135 g_exit_manager = NULL; |
| 136 ShutdownCrashReporting(); | 136 ShutdownCrashReporting(); |
| 137 } | 137 } |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 sd.GetDacl(&new_dacl); | 486 sd.GetDacl(&new_dacl); |
| 487 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); | 487 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); |
| 488 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { | 488 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { |
| 489 result = SetOrDeleteMimeHandlerKey(enable); | 489 result = SetOrDeleteMimeHandlerKey(enable); |
| 490 } | 490 } |
| 491 } | 491 } |
| 492 | 492 |
| 493 backup.RestoreSecurity(object_name.c_str()); | 493 backup.RestoreSecurity(object_name.c_str()); |
| 494 return result; | 494 return result; |
| 495 } | 495 } |
| OLD | NEW |