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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
17 #include "base/string_split.h" | 17 #include "base/string_split.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/win/metro.h" | |
20 #include "base/win/pe_image.h" | 19 #include "base/win/pe_image.h" |
21 #include "base/win/registry.h" | 20 #include "base/win/registry.h" |
22 #include "base/win/scoped_handle.h" | 21 #include "base/win/scoped_handle.h" |
23 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
24 #include "webkit/plugins/npapi/plugin_constants_win.h" | 23 #include "webkit/plugins/npapi/plugin_constants_win.h" |
25 #include "webkit/plugins/npapi/plugin_lib.h" | 24 #include "webkit/plugins/npapi/plugin_lib.h" |
26 #include "webkit/plugins/plugin_switches.h" | 25 #include "webkit/plugins/plugin_switches.h" |
27 #include "webkit/glue/webkit_glue.h" | 26 #include "webkit/glue/webkit_glue.h" |
28 | 27 |
29 namespace webkit { | 28 namespace webkit { |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 int major, minor, update; | 382 int major, minor, update; |
384 if (ver.size() == 4 && | 383 if (ver.size() == 4 && |
385 base::StringToInt(ver[0], &major) && | 384 base::StringToInt(ver[0], &major) && |
386 base::StringToInt(ver[1], &minor) && | 385 base::StringToInt(ver[1], &minor) && |
387 base::StringToInt(ver[2], &update)) { | 386 base::StringToInt(ver[2], &update)) { |
388 if (major == 6 && minor == 0 && update < 120) | 387 if (major == 6 && minor == 0 && update < 120) |
389 return false; // Java SE6 Update 11 or older. | 388 return false; // Java SE6 Update 11 or older. |
390 } | 389 } |
391 } | 390 } |
392 | 391 |
393 if (base::win::IsMetroProcess()) { | |
394 // In metro mode we only allow pepper plugins. | |
395 if (info.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) | |
396 return false; | |
397 } | |
398 | |
399 // Special WMP handling | 392 // Special WMP handling |
400 | 393 |
401 // If both the new and old WMP plugins exist, only load the new one. | 394 // If both the new and old WMP plugins exist, only load the new one. |
402 if (filename == kNewWMPPlugin) { | 395 if (filename == kNewWMPPlugin) { |
403 if (dont_load_new_wmp_) | 396 if (dont_load_new_wmp_) |
404 return false; | 397 return false; |
405 | 398 |
406 for (size_t j = 0; j < plugins->size(); ++j) { | 399 for (size_t j = 0; j < plugins->size(); ++j) { |
407 if ((*plugins)[j].path.BaseName().value() == kOldWMPPlugin) { | 400 if ((*plugins)[j].path.BaseName().value() == kOldWMPPlugin) { |
408 PluginList::RemovePlugin((*plugins)[j].path, plugins); | 401 PluginList::RemovePlugin((*plugins)[j].path, plugins); |
(...skipping 19 matching lines...) Expand all Loading... |
428 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path))) | 421 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path))) |
429 load_plugin = false; | 422 load_plugin = false; |
430 break; | 423 break; |
431 } | 424 } |
432 return load_plugin; | 425 return load_plugin; |
433 } | 426 } |
434 | 427 |
435 | 428 |
436 } // namespace npapi | 429 } // namespace npapi |
437 } // namespace webkit | 430 } // namespace webkit |
OLD | NEW |