| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  259   GenerateHash(WideToUTF8(module.name), &filename_hash); |  259   GenerateHash(WideToUTF8(module.name), &filename_hash); | 
|  260   GenerateHash(WideToUTF8(module.location), &location_hash); |  260   GenerateHash(WideToUTF8(module.location), &location_hash); | 
|  261  |  261  | 
|  262   // Filenames are mandatory. Location is mandatory if given. |  262   // Filenames are mandatory. Location is mandatory if given. | 
|  263   if (filename_hash == blacklisted.filename && |  263   if (filename_hash == blacklisted.filename && | 
|  264           (std::string(blacklisted.location).empty() || |  264           (std::string(blacklisted.location).empty() || | 
|  265           location_hash == blacklisted.location)) { |  265           location_hash == blacklisted.location)) { | 
|  266     // We have a name match against the blacklist (and possibly location match |  266     // We have a name match against the blacklist (and possibly location match | 
|  267     // also), so check version. |  267     // also), so check version. | 
|  268     scoped_ptr<Version> module_version( |  268     scoped_ptr<Version> module_version( | 
|  269         Version::GetVersionFromString(module.version)); |  269         Version::GetVersionFromString(UTF16ToASCII(module.version))); | 
|  270     scoped_ptr<Version> version_min( |  270     scoped_ptr<Version> version_min( | 
|  271         Version::GetVersionFromString(blacklisted.version_from)); |  271         Version::GetVersionFromString(blacklisted.version_from)); | 
|  272     scoped_ptr<Version> version_max( |  272     scoped_ptr<Version> version_max( | 
|  273         Version::GetVersionFromString(blacklisted.version_to)); |  273         Version::GetVersionFromString(blacklisted.version_to)); | 
|  274     bool version_ok = !version_min.get() && !version_max.get(); |  274     bool version_ok = !version_min.get() && !version_max.get(); | 
|  275     if (!version_ok) { |  275     if (!version_ok) { | 
|  276       bool too_low = version_min.get() && |  276       bool too_low = version_min.get() && | 
|  277           (!module_version.get() || |  277           (!module_version.get() || | 
|  278           module_version->CompareTo(*version_min.get()) < 0); |  278           module_version->CompareTo(*version_min.get()) < 0); | 
|  279       bool too_high = version_max.get() && |  279       bool too_high = version_max.get() && | 
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  843   GenerateHash(WideToUTF8(module.name), &filename); |  843   GenerateHash(WideToUTF8(module.name), &filename); | 
|  844   GenerateHash(WideToUTF8(module.location), &location); |  844   GenerateHash(WideToUTF8(module.location), &location); | 
|  845   GenerateHash(WideToUTF8(module.description), &description); |  845   GenerateHash(WideToUTF8(module.description), &description); | 
|  846   GenerateHash(WideToUTF8(module.digital_signer), &signer); |  846   GenerateHash(WideToUTF8(module.digital_signer), &signer); | 
|  847  |  847  | 
|  848   string16 url = l10n_util::GetStringF(IDS_HELP_CENTER_VIEW_CONFLICTS, |  848   string16 url = l10n_util::GetStringF(IDS_HELP_CENTER_VIEW_CONFLICTS, | 
|  849       ASCIIToWide(filename), ASCIIToWide(location), |  849       ASCIIToWide(filename), ASCIIToWide(location), | 
|  850       ASCIIToWide(description), ASCIIToWide(signer)); |  850       ASCIIToWide(description), ASCIIToWide(signer)); | 
|  851   return GURL(WideToUTF8(url)); |  851   return GURL(WideToUTF8(url)); | 
|  852 } |  852 } | 
| OLD | NEW |