| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 bool PluginList::GetPluginInfo(const GURL& url, | 377 bool PluginList::GetPluginInfo(const GURL& url, |
| 378 const std::string& mime_type, | 378 const std::string& mime_type, |
| 379 bool allow_wildcard, | 379 bool allow_wildcard, |
| 380 WebPluginInfo* info, | 380 WebPluginInfo* info, |
| 381 std::string* actual_mime_type) { | 381 std::string* actual_mime_type) { |
| 382 bool found = FindPlugin(mime_type, allow_wildcard, info); | 382 bool found = FindPlugin(mime_type, allow_wildcard, info); |
| 383 if (!found || (info->path.value() == kDefaultPluginLibraryName)) { | 383 if (!found || (info->path.value() == kDefaultPluginLibraryName)) { |
| 384 WebPluginInfo info2; | 384 found = FindPlugin(url, actual_mime_type, info) || |
| 385 if (FindPlugin(url, actual_mime_type, &info2)) { | 385 FindDisabledPlugin(mime_type, allow_wildcard, info); |
| 386 found = true; | |
| 387 *info = info2; | |
| 388 } else if (FindDisabledPlugin(mime_type, allow_wildcard, &info2)) { | |
| 389 found = false; | |
| 390 } | |
| 391 } | 386 } |
| 392 | 387 |
| 393 return found; | 388 return found; |
| 394 } | 389 } |
| 395 | 390 |
| 396 bool PluginList::GetPluginInfoByPath(const FilePath& plugin_path, | 391 bool PluginList::GetPluginInfoByPath(const FilePath& plugin_path, |
| 397 WebPluginInfo* info) { | 392 WebPluginInfo* info) { |
| 398 LoadPlugins(false); | 393 LoadPlugins(false); |
| 399 AutoLock lock(lock_); | 394 AutoLock lock(lock_); |
| 400 for (size_t i = 0; i < plugins_.size(); ++i) { | 395 for (size_t i = 0; i < plugins_.size(); ++i) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 449 } |
| 455 | 450 |
| 456 return did_disable; | 451 return did_disable; |
| 457 } | 452 } |
| 458 | 453 |
| 459 void PluginList::Shutdown() { | 454 void PluginList::Shutdown() { |
| 460 // TODO | 455 // TODO |
| 461 } | 456 } |
| 462 | 457 |
| 463 } // namespace NPAPI | 458 } // namespace NPAPI |
| OLD | NEW |