| 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 #include "chrome/browser/enumerate_modules_model_win.h" | 5 #include "chrome/browser/enumerate_modules_model_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 7 #include <Tlhelp32.h> | 9 #include <Tlhelp32.h> |
| 8 #include <wintrust.h> | 10 #include <wintrust.h> |
| 9 #include <algorithm> | 11 #include <algorithm> |
| 10 | 12 |
| 11 #include "base/bind.h" | 13 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 13 #include "base/environment.h" | 15 #include "base/environment.h" |
| 14 #include "base/file_version_info_win.h" | 16 #include "base/file_version_info_win.h" |
| 15 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 16 #include "base/i18n/case_conversion.h" | 18 #include "base/i18n/case_conversion.h" |
| 19 #include "base/macros.h" |
| 17 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
| 18 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 19 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/time/time.h" | 24 #include "base/time/time.h" |
| 22 #include "base/values.h" | 25 #include "base/values.h" |
| 23 #include "base/version.h" | 26 #include "base/version.h" |
| 24 #include "base/win/registry.h" | 27 #include "base/win/registry.h" |
| 25 #include "base/win/scoped_handle.h" | 28 #include "base/win/scoped_handle.h" |
| 26 #include "base/win/windows_version.h" | 29 #include "base/win/windows_version.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 { "e967210d", "23d01d5b", "", "", "", ALL, kUninstallLink }, | 343 { "e967210d", "23d01d5b", "", "", "", ALL, kUninstallLink }, |
| 341 }; | 344 }; |
| 342 | 345 |
| 343 // Generates an 8 digit hash from the input given. | 346 // Generates an 8 digit hash from the input given. |
| 344 static void GenerateHash(const std::string& input, std::string* output) { | 347 static void GenerateHash(const std::string& input, std::string* output) { |
| 345 if (input.empty()) { | 348 if (input.empty()) { |
| 346 *output = ""; | 349 *output = ""; |
| 347 return; | 350 return; |
| 348 } | 351 } |
| 349 | 352 |
| 350 uint8 hash[4]; | 353 uint8_t hash[4]; |
| 351 crypto::SHA256HashString(input, hash, sizeof(hash)); | 354 crypto::SHA256HashString(input, hash, sizeof(hash)); |
| 352 *output = base::ToLowerASCII(base::HexEncode(hash, sizeof(hash))); | 355 *output = base::ToLowerASCII(base::HexEncode(hash, sizeof(hash))); |
| 353 } | 356 } |
| 354 | 357 |
| 355 // ----------------------------------------------------------------------------- | 358 // ----------------------------------------------------------------------------- |
| 356 | 359 |
| 357 // static | 360 // static |
| 358 void ModuleEnumerator::NormalizeModule(Module* module) { | 361 void ModuleEnumerator::NormalizeModule(Module* module) { |
| 359 base::string16 path = module->location; | 362 base::string16 path = module->location; |
| 360 if (!ConvertToLongPath(path, &module->location)) | 363 if (!ConvertToLongPath(path, &module->location)) |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 GenerateHash(base::WideToUTF8(module.location), &location); | 1071 GenerateHash(base::WideToUTF8(module.location), &location); |
| 1069 GenerateHash(base::WideToUTF8(module.description), &description); | 1072 GenerateHash(base::WideToUTF8(module.description), &description); |
| 1070 GenerateHash(base::WideToUTF8(module.digital_signer), &signer); | 1073 GenerateHash(base::WideToUTF8(module.digital_signer), &signer); |
| 1071 | 1074 |
| 1072 base::string16 url = | 1075 base::string16 url = |
| 1073 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, | 1076 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, |
| 1074 base::ASCIIToUTF16(filename), base::ASCIIToUTF16(location), | 1077 base::ASCIIToUTF16(filename), base::ASCIIToUTF16(location), |
| 1075 base::ASCIIToUTF16(description), base::ASCIIToUTF16(signer)); | 1078 base::ASCIIToUTF16(description), base::ASCIIToUTF16(signer)); |
| 1076 return GURL(base::UTF16ToUTF8(url)); | 1079 return GURL(base::UTF16ToUTF8(url)); |
| 1077 } | 1080 } |
| OLD | NEW |