| OLD | NEW |
| 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 "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
| 6 | 6 |
| 7 #include <tchar.h> | 7 #include <tchar.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 return false; | 310 return false; |
| 311 } | 311 } |
| 312 | 312 |
| 313 // Compares Windows style version strings (i.e. 1,2,3,4). Returns true if b's | 313 // Compares Windows style version strings (i.e. 1,2,3,4). Returns true if b's |
| 314 // version is newer than a's, or false if it's equal or older. | 314 // version is newer than a's, or false if it's equal or older. |
| 315 bool IsNewerVersion(const std::wstring& a, const std::wstring& b) { | 315 bool IsNewerVersion(const std::wstring& a, const std::wstring& b) { |
| 316 std::vector<std::wstring> a_ver, b_ver; | 316 std::vector<std::wstring> a_ver, b_ver; |
| 317 base::SplitString(a, ',', &a_ver); | 317 base::SplitString(a, ',', &a_ver); |
| 318 base::SplitString(b, ',', &b_ver); | 318 base::SplitString(b, ',', &b_ver); |
| 319 if (a_ver.size() == 1 && b_ver.size() == 1) { | 319 if (a_ver.size() == 1 && b_ver.size() == 1) { |
| 320 a_ver.clear(); | |
| 321 b_ver.clear(); | |
| 322 base::SplitString(a, '.', &a_ver); | 320 base::SplitString(a, '.', &a_ver); |
| 323 base::SplitString(b, '.', &b_ver); | 321 base::SplitString(b, '.', &b_ver); |
| 324 } | 322 } |
| 325 if (a_ver.size() != b_ver.size()) | 323 if (a_ver.size() != b_ver.size()) |
| 326 return false; | 324 return false; |
| 327 for (size_t i = 0; i < a_ver.size(); i++) { | 325 for (size_t i = 0; i < a_ver.size(); i++) { |
| 328 int cur_a, cur_b; | 326 int cur_a, cur_b; |
| 329 base::StringToInt(a_ver[i], &cur_a); | 327 base::StringToInt(a_ver[i], &cur_a); |
| 330 base::StringToInt(b_ver[i], &cur_b); | 328 base::StringToInt(b_ver[i], &cur_b); |
| 331 | 329 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 437 |
| 440 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path))) | 438 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path))) |
| 441 load_plugin = false; | 439 load_plugin = false; |
| 442 break; | 440 break; |
| 443 } | 441 } |
| 444 return load_plugin; | 442 return load_plugin; |
| 445 } | 443 } |
| 446 | 444 |
| 447 } // namespace npapi | 445 } // namespace npapi |
| 448 } // namespace webkit | 446 } // namespace webkit |
| OLD | NEW |