OLD | NEW |
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 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 FileVersionInfo::CreateFileVersionInfo(install_path)); | 173 FileVersionInfo::CreateFileVersionInfo(install_path)); |
174 if (!file_version_info) | 174 if (!file_version_info) |
175 return false; | 175 return false; |
176 | 176 |
177 std::string reader_version = | 177 std::string reader_version = |
178 base::UTF16ToUTF8(file_version_info->product_version()); | 178 base::UTF16ToUTF8(file_version_info->product_version()); |
179 // Convert 1.2.03.45 to 1.2.3.45 so base::Version considers it as valid. | 179 // Convert 1.2.03.45 to 1.2.3.45 so base::Version considers it as valid. |
180 for (int i = 1; i <= 9; ++i) { | 180 for (int i = 1; i <= 9; ++i) { |
181 std::string from = base::StringPrintf(".0%d", i); | 181 std::string from = base::StringPrintf(".0%d", i); |
182 std::string to = base::StringPrintf(".%d", i); | 182 std::string to = base::StringPrintf(".%d", i); |
183 ReplaceSubstringsAfterOffset(&reader_version, 0, from, to); | 183 base::ReplaceSubstringsAfterOffset(&reader_version, 0, from, to); |
184 } | 184 } |
185 base::Version file_version(reader_version); | 185 base::Version file_version(reader_version); |
186 return file_version.IsValid() && !file_version.IsOlderThan(kSecureVersion); | 186 return file_version.IsValid() && !file_version.IsOlderThan(kSecureVersion); |
187 } | 187 } |
OLD | NEW |