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

Side by Side Diff: webkit/glue/plugins/plugin_list_win.cc

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 years, 2 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 (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 "webkit/glue/plugins/plugin_list.h" 5 #include "webkit/glue/plugins/plugin_list.h"
6 6
7 #include <tchar.h> 7 #include <tchar.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 297 }
298 } 298 }
299 299
300 return false; 300 return false;
301 } 301 }
302 302
303 // Compares Windows style version strings (i.e. 1,2,3,4). Returns true if b's 303 // Compares Windows style version strings (i.e. 1,2,3,4). Returns true if b's
304 // version is newer than a's, or false if it's equal or older. 304 // version is newer than a's, or false if it's equal or older.
305 bool IsNewerVersion(const std::wstring& a, const std::wstring& b) { 305 bool IsNewerVersion(const std::wstring& a, const std::wstring& b) {
306 std::vector<std::wstring> a_ver, b_ver; 306 std::vector<std::wstring> a_ver, b_ver;
307 SplitString(a, ',', &a_ver); 307 base::SplitString(a, ',', &a_ver);
308 SplitString(b, ',', &b_ver); 308 base::SplitString(b, ',', &b_ver);
309 if (a_ver.size() == 1 && b_ver.size() == 1) { 309 if (a_ver.size() == 1 && b_ver.size() == 1) {
310 a_ver.clear(); 310 a_ver.clear();
311 b_ver.clear(); 311 b_ver.clear();
312 SplitString(a, '.', &a_ver); 312 base::SplitString(a, '.', &a_ver);
313 SplitString(b, '.', &b_ver); 313 base::SplitString(b, '.', &b_ver);
314 } 314 }
315 if (a_ver.size() != b_ver.size()) 315 if (a_ver.size() != b_ver.size())
316 return false; 316 return false;
317 for (size_t i = 0; i < a_ver.size(); i++) { 317 for (size_t i = 0; i < a_ver.size(); i++) {
318 int cur_a, cur_b; 318 int cur_a, cur_b;
319 base::StringToInt(a_ver[i], &cur_a); 319 base::StringToInt(a_ver[i], &cur_a);
320 base::StringToInt(b_ver[i], &cur_b); 320 base::StringToInt(b_ver[i], &cur_b);
321 321
322 if (cur_a > cur_b) 322 if (cur_a > cur_b)
323 return false; 323 return false;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 // chrome during shutdown. Firefox also disables this plugin. 364 // chrome during shutdown. Firefox also disables this plugin.
365 // Please refer to http://code.google.com/p/chromium/issues/detail?id=3953 365 // Please refer to http://code.google.com/p/chromium/issues/detail?id=3953
366 // for more information. 366 // for more information.
367 if (filename == kWanWangProtocolHandlerPlugin) 367 if (filename == kWanWangProtocolHandlerPlugin)
368 return false; 368 return false;
369 369
370 // We only work with newer versions of the Java plugin which use NPAPI only 370 // We only work with newer versions of the Java plugin which use NPAPI only
371 // and don't depend on XPCOM. 371 // and don't depend on XPCOM.
372 if (filename == kJavaPlugin1 || filename == kJavaPlugin2) { 372 if (filename == kJavaPlugin1 || filename == kJavaPlugin2) {
373 std::vector<std::wstring> ver; 373 std::vector<std::wstring> ver;
374 SplitString(info.version, '.', &ver); 374 base::SplitString(info.version, '.', &ver);
375 int major, minor, update; 375 int major, minor, update;
376 if (ver.size() == 4 && 376 if (ver.size() == 4 &&
377 base::StringToInt(ver[0], &major) && 377 base::StringToInt(ver[0], &major) &&
378 base::StringToInt(ver[1], &minor) && 378 base::StringToInt(ver[1], &minor) &&
379 base::StringToInt(ver[2], &update)) { 379 base::StringToInt(ver[2], &update)) {
380 if (major == 6 && minor == 0 && update < 120) 380 if (major == 6 && minor == 0 && update < 120)
381 return false; // Java SE6 Update 11 or older. 381 return false; // Java SE6 Update 11 or older.
382 } 382 }
383 } 383 }
384 384
(...skipping 14 matching lines...) Expand all
399 for (size_t i = 0; i < plugins->size(); ++i) { 399 for (size_t i = 0; i < plugins->size(); ++i) {
400 if ((*plugins)[i].path.BaseName().value() == kNewWMPPlugin) 400 if ((*plugins)[i].path.BaseName().value() == kNewWMPPlugin)
401 return false; 401 return false;
402 } 402 }
403 } 403 }
404 404
405 return true; 405 return true;
406 } 406 }
407 407
408 } // namespace NPAPI 408 } // namespace NPAPI
OLDNEW
« no previous file with comments | « webkit/glue/plugins/plugin_list_posix.cc ('k') | webkit/glue/plugins/webplugin_delegate_impl_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698