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

Side by Side Diff: chrome/browser/ui/pdf/adobe_reader_info_win.cc

Issue 1575523002: Comparison and streaming operators for base::Version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes mistake in previous patch set. Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/pdf/adobe_reader_info_win.h" 5 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
6 6
7 #include <shlwapi.h> 7 #include <shlwapi.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 std::string reader_version = 178 std::string reader_version =
179 base::UTF16ToUTF8(file_version_info->product_version()); 179 base::UTF16ToUTF8(file_version_info->product_version());
180 // Convert 1.2.03.45 to 1.2.3.45 so base::Version considers it as valid. 180 // Convert 1.2.03.45 to 1.2.3.45 so base::Version considers it as valid.
181 for (int i = 1; i <= 9; ++i) { 181 for (int i = 1; i <= 9; ++i) {
182 std::string from = base::StringPrintf(".0%d", i); 182 std::string from = base::StringPrintf(".0%d", i);
183 std::string to = base::StringPrintf(".%d", i); 183 std::string to = base::StringPrintf(".%d", i);
184 base::ReplaceSubstringsAfterOffset(&reader_version, 0, from, to); 184 base::ReplaceSubstringsAfterOffset(&reader_version, 0, from, to);
185 } 185 }
186 base::Version file_version(reader_version); 186 base::Version file_version(reader_version);
187 return file_version.IsValid() && !file_version.IsOlderThan(kSecureVersion); 187 return file_version.IsValid() &&
188 file_version >= base::Version(kSecureVersion);
188 } 189 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_sync_service.cc ('k') | chrome/browser/ui/startup/default_browser_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698