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

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

Issue 5848005: base/version: remove wstring version (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retry Created 10 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) 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
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
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 }
OLDNEW
« no previous file with comments | « chrome/app/client_util.cc ('k') | chrome/browser/extensions/external_registry_extension_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698