OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <Tlhelp32.h> | 7 #include <Tlhelp32.h> |
8 #include <wintrust.h> | 8 #include <wintrust.h> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 if (a.location == b.location) | 52 if (a.location == b.location) |
53 return a.name < b.name; | 53 return a.name < b.name; |
54 | 54 |
55 return a.location < b.location; | 55 return a.location < b.location; |
56 } | 56 } |
57 | 57 |
58 namespace { | 58 namespace { |
59 | 59 |
60 // Used to protect the LoadedModuleVector which is accessed | 60 // Used to protect the LoadedModuleVector which is accessed |
61 // from both the UI thread and the FILE thread. | 61 // from both the UI thread and the FILE thread. |
62 Lock* lock = NULL; | 62 base::Lock* lock = NULL; |
63 | 63 |
64 // A struct to help de-duping modules before adding them to the enumerated | 64 // A struct to help de-duping modules before adding them to the enumerated |
65 // modules vector. | 65 // modules vector. |
66 struct FindModule { | 66 struct FindModule { |
67 public: | 67 public: |
68 explicit FindModule(const ModuleEnumerator::Module& x) | 68 explicit FindModule(const ModuleEnumerator::Module& x) |
69 : module(x) {} | 69 : module(x) {} |
70 bool operator()(const ModuleEnumerator::Module& module_in) const { | 70 bool operator()(const ModuleEnumerator::Module& module_in) const { |
71 return (module.location == module_in.location) && | 71 return (module.location == module_in.location) && |
72 (module.name == module_in.name); | 72 (module.name == module_in.name); |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 GenerateHash(WideToUTF8(module.name), &filename); | 879 GenerateHash(WideToUTF8(module.name), &filename); |
880 GenerateHash(WideToUTF8(module.location), &location); | 880 GenerateHash(WideToUTF8(module.location), &location); |
881 GenerateHash(WideToUTF8(module.description), &description); | 881 GenerateHash(WideToUTF8(module.description), &description); |
882 GenerateHash(WideToUTF8(module.digital_signer), &signer); | 882 GenerateHash(WideToUTF8(module.digital_signer), &signer); |
883 | 883 |
884 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, | 884 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, |
885 ASCIIToUTF16(filename), ASCIIToUTF16(location), | 885 ASCIIToUTF16(filename), ASCIIToUTF16(location), |
886 ASCIIToUTF16(description), ASCIIToUTF16(signer)); | 886 ASCIIToUTF16(description), ASCIIToUTF16(signer)); |
887 return GURL(UTF16ToUTF8(url)); | 887 return GURL(UTF16ToUTF8(url)); |
888 } | 888 } |
OLD | NEW |