Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome/browser/enumerate_modules_model_win.cc

Issue 109673004: Revert "Update all users of base::Version to explicitly specify the namespace, and clean up the hea… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <Tlhelp32.h> 7 #include <Tlhelp32.h>
8 #include <wintrust.h> 8 #include <wintrust.h>
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 std::string filename_hash, location_hash; 377 std::string filename_hash, location_hash;
378 GenerateHash(base::WideToUTF8(module.name), &filename_hash); 378 GenerateHash(base::WideToUTF8(module.name), &filename_hash);
379 GenerateHash(base::WideToUTF8(module.location), &location_hash); 379 GenerateHash(base::WideToUTF8(module.location), &location_hash);
380 380
381 // Filenames are mandatory. Location is mandatory if given. 381 // Filenames are mandatory. Location is mandatory if given.
382 if (filename_hash == blacklisted.filename && 382 if (filename_hash == blacklisted.filename &&
383 (std::string(blacklisted.location).empty() || 383 (std::string(blacklisted.location).empty() ||
384 location_hash == blacklisted.location)) { 384 location_hash == blacklisted.location)) {
385 // We have a name match against the blacklist (and possibly location match 385 // We have a name match against the blacklist (and possibly location match
386 // also), so check version. 386 // also), so check version.
387 base::Version module_version(UTF16ToASCII(module.version)); 387 Version module_version(UTF16ToASCII(module.version));
388 base::Version version_min(blacklisted.version_from); 388 Version version_min(blacklisted.version_from);
389 base::Version version_max(blacklisted.version_to); 389 Version version_max(blacklisted.version_to);
390 bool version_ok = !version_min.IsValid() && !version_max.IsValid(); 390 bool version_ok = !version_min.IsValid() && !version_max.IsValid();
391 if (!version_ok) { 391 if (!version_ok) {
392 bool too_low = version_min.IsValid() && 392 bool too_low = version_min.IsValid() &&
393 (!module_version.IsValid() || 393 (!module_version.IsValid() ||
394 module_version.CompareTo(version_min) < 0); 394 module_version.CompareTo(version_min) < 0);
395 bool too_high = version_max.IsValid() && 395 bool too_high = version_max.IsValid() &&
396 (!module_version.IsValid() || 396 (!module_version.IsValid() ||
397 module_version.CompareTo(version_max) >= 0); 397 module_version.CompareTo(version_max) >= 0);
398 version_ok = !too_low && !too_high; 398 version_ok = !too_low && !too_high;
399 } 399 }
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 GenerateHash(base::WideToUTF8(module.location), &location); 1063 GenerateHash(base::WideToUTF8(module.location), &location);
1064 GenerateHash(base::WideToUTF8(module.description), &description); 1064 GenerateHash(base::WideToUTF8(module.description), &description);
1065 GenerateHash(base::WideToUTF8(module.digital_signer), &signer); 1065 GenerateHash(base::WideToUTF8(module.digital_signer), &signer);
1066 1066
1067 base::string16 url = 1067 base::string16 url =
1068 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, 1068 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS,
1069 base::ASCIIToUTF16(filename), base::ASCIIToUTF16(location), 1069 base::ASCIIToUTF16(filename), base::ASCIIToUTF16(location),
1070 base::ASCIIToUTF16(description), base::ASCIIToUTF16(signer)); 1070 base::ASCIIToUTF16(description), base::ASCIIToUTF16(signer));
1071 return GURL(base::UTF16ToUTF8(url)); 1071 return GURL(base::UTF16ToUTF8(url));
1072 } 1072 }
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/update_response.cc ('k') | chrome/browser/extensions/api/runtime/runtime_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698