Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ | 5 #ifndef CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ |
| 6 #define CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ | 6 #define CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ |
| 7 | 7 |
| 8 #include <utility> | |
| 9 #include <vector> | |
| 10 | |
| 8 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 9 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 10 | 13 |
| 11 // The type of certificate found for the module. | 14 // The type of certificate found for the module. |
| 12 enum class CertificateType { | 15 enum class CertificateType { |
| 13 // The module is not signed. | 16 // The module is not signed. |
| 14 NO_CERTIFICATE, | 17 NO_CERTIFICATE, |
| 15 // The module is signed and the certificate is in the module. | 18 // The module is signed and the certificate is in the module. |
| 16 CERTIFICATE_IN_FILE, | 19 CERTIFICATE_IN_FILE, |
| 17 // The module is signed and the certificate is in an external catalog. | 20 // The module is signed and the certificate is in an external catalog. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 33 // "Google Inc." or "Microsoft Inc."). | 36 // "Google Inc." or "Microsoft Inc."). |
| 34 base::string16 subject; | 37 base::string16 subject; |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 // Extracts information about the certificate of the given |file|, populating | 40 // Extracts information about the certificate of the given |file|, populating |
| 38 // |certificate_info|. It is expected that |certificate_info| be freshly | 41 // |certificate_info|. It is expected that |certificate_info| be freshly |
| 39 // constructed. | 42 // constructed. |
| 40 void GetCertificateInfo(const base::FilePath& file, | 43 void GetCertificateInfo(const base::FilePath& file, |
| 41 CertificateInfo* certificate_info); | 44 CertificateInfo* certificate_info); |
| 42 | 45 |
| 46 // Returns a mapping of the value of an environment variable to its name. | |
| 47 // | |
| 48 // e.g. c:\windows\system32\ -> %systemroot% | |
| 49 using StringMapping = std::vector<std::pair<base::string16, base::string16>>; | |
| 50 StringMapping GetEnvironmentVariablesMapping( | |
| 51 const std::vector<base::string16>& environment_variables); | |
| 52 | |
| 53 // Given a mapping of prefixes to their respective substitution values, searches | |
| 54 // for a matching prefix in |string| that contains a mapping in |prefix_mapping| | |
| 55 // and replaces it with its associated value. This function goes over all the | |
| 56 // values in the mapping to ensure the best fit is chosen. | |
|
chrisha
2017/02/28 18:51:29
Not the best wording? Maybe an example as well?
Patrick Monette
2017/02/28 23:37:38
I've reworded this and I think an example is not n
| |
| 57 void CollapseMatchingPrefixInString(const StringMapping& prefix_mapping, | |
| 58 base::string16* string); | |
| 59 | |
| 43 #endif // CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ | 60 #endif // CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ |
| OLD | NEW |