OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 const_cast<LPWSTR>(subject_name.c_str()), | 665 const_cast<LPWSTR>(subject_name.c_str()), |
666 subject_name_size))) { | 666 subject_name_size))) { |
667 return string16(); | 667 return string16(); |
668 } | 668 } |
669 | 669 |
670 return subject_name; | 670 return subject_name; |
671 } | 671 } |
672 | 672 |
673 // ---------------------------------------------------------------------------- | 673 // ---------------------------------------------------------------------------- |
674 | 674 |
| 675 // static |
| 676 EnumerateModulesModel* EnumerateModulesModel::GetInstance() { |
| 677 return Singleton<EnumerateModulesModel>::get(); |
| 678 } |
| 679 |
675 void EnumerateModulesModel::ScanNow() { | 680 void EnumerateModulesModel::ScanNow() { |
676 if (scanning_) | 681 if (scanning_) |
677 return; // A scan is already in progress. | 682 return; // A scan is already in progress. |
678 | 683 |
679 lock->Acquire(); // Balanced in DoneScanning(); | 684 lock->Acquire(); // Balanced in DoneScanning(); |
680 | 685 |
681 scanning_ = true; | 686 scanning_ = true; |
682 | 687 |
683 // Instruct the ModuleEnumerator class to load this on the File thread. | 688 // Instruct the ModuleEnumerator class to load this on the File thread. |
684 // ScanNow does not block. | 689 // ScanNow does not block. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 GenerateHash(WideToUTF8(module.name), &filename); | 838 GenerateHash(WideToUTF8(module.name), &filename); |
834 GenerateHash(WideToUTF8(module.location), &location); | 839 GenerateHash(WideToUTF8(module.location), &location); |
835 GenerateHash(WideToUTF8(module.description), &description); | 840 GenerateHash(WideToUTF8(module.description), &description); |
836 GenerateHash(WideToUTF8(module.digital_signer), &signer); | 841 GenerateHash(WideToUTF8(module.digital_signer), &signer); |
837 | 842 |
838 string16 url = l10n_util::GetStringF(IDS_HELP_CENTER_VIEW_CONFLICTS, | 843 string16 url = l10n_util::GetStringF(IDS_HELP_CENTER_VIEW_CONFLICTS, |
839 ASCIIToWide(filename), ASCIIToWide(location), | 844 ASCIIToWide(filename), ASCIIToWide(location), |
840 ASCIIToWide(description), ASCIIToWide(signer)); | 845 ASCIIToWide(description), ASCIIToWide(signer)); |
841 return GURL(WideToUTF8(url)); | 846 return GURL(WideToUTF8(url)); |
842 } | 847 } |
OLD | NEW |