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

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

Issue 100543005: Update all users of base::Version to explicitly specify the namespace, and clean up the header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: someday it will work Created 7 years 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(WideToUTF8(module.name), &filename_hash); 378 GenerateHash(WideToUTF8(module.name), &filename_hash);
379 GenerateHash(WideToUTF8(module.location), &location_hash); 379 GenerateHash(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 Version module_version(UTF16ToASCII(module.version)); 387 base::Version module_version(UTF16ToASCII(module.version));
388 Version version_min(blacklisted.version_from); 388 base::Version version_min(blacklisted.version_from);
389 Version version_max(blacklisted.version_to); 389 base::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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 GenerateHash(WideToUTF8(module.location), &location); 1060 GenerateHash(WideToUTF8(module.location), &location);
1061 GenerateHash(WideToUTF8(module.description), &description); 1061 GenerateHash(WideToUTF8(module.description), &description);
1062 GenerateHash(WideToUTF8(module.digital_signer), &signer); 1062 GenerateHash(WideToUTF8(module.digital_signer), &signer);
1063 1063
1064 base::string16 url = 1064 base::string16 url =
1065 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, 1065 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS,
1066 ASCIIToUTF16(filename), ASCIIToUTF16(location), 1066 ASCIIToUTF16(filename), ASCIIToUTF16(location),
1067 ASCIIToUTF16(description), ASCIIToUTF16(signer)); 1067 ASCIIToUTF16(description), ASCIIToUTF16(signer));
1068 return GURL(UTF16ToUTF8(url)); 1068 return GURL(UTF16ToUTF8(url));
1069 } 1069 }
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