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 "content/browser/plugin_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 webkit::WebPluginInfo* info, | 482 webkit::WebPluginInfo* info, |
483 std::string* actual_mime_type) { | 483 std::string* actual_mime_type) { |
484 std::vector<webkit::WebPluginInfo> plugins; | 484 std::vector<webkit::WebPluginInfo> plugins; |
485 std::vector<std::string> mime_types; | 485 std::vector<std::string> mime_types; |
486 bool stale = GetPluginInfoArray( | 486 bool stale = GetPluginInfoArray( |
487 url, mime_type, allow_wildcard, &plugins, &mime_types); | 487 url, mime_type, allow_wildcard, &plugins, &mime_types); |
488 if (is_stale) | 488 if (is_stale) |
489 *is_stale = stale; | 489 *is_stale = stale; |
490 | 490 |
491 for (size_t i = 0; i < plugins.size(); ++i) { | 491 for (size_t i = 0; i < plugins.size(); ++i) { |
492 if (!filter_ || filter_->IsPluginEnabled(render_process_id, | 492 if (!filter_ || filter_->IsPluginAvailable(render_process_id, |
493 render_view_id, | 493 render_view_id, |
494 context, | 494 context, |
495 url, | 495 url, |
496 page_url, | 496 page_url, |
497 &plugins[i])) { | 497 &plugins[i])) { |
498 *info = plugins[i]; | 498 *info = plugins[i]; |
499 if (actual_mime_type) | 499 if (actual_mime_type) |
500 *actual_mime_type = mime_types[i]; | 500 *actual_mime_type = mime_types[i]; |
501 return true; | 501 return true; |
502 } | 502 } |
503 } | 503 } |
504 return false; | 504 return false; |
505 } | 505 } |
506 | 506 |
507 bool PluginServiceImpl::GetPluginInfoByPath(const FilePath& plugin_path, | 507 bool PluginServiceImpl::GetPluginInfoByPath(const FilePath& plugin_path, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 void PluginServiceImpl::GetInternalPlugins( | 746 void PluginServiceImpl::GetInternalPlugins( |
747 std::vector<webkit::WebPluginInfo>* plugins) { | 747 std::vector<webkit::WebPluginInfo>* plugins) { |
748 plugin_list_->GetInternalPlugins(plugins); | 748 plugin_list_->GetInternalPlugins(plugins); |
749 } | 749 } |
750 | 750 |
751 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { | 751 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { |
752 return plugin_list_; | 752 return plugin_list_; |
753 } | 753 } |
754 | 754 |
755 } // namespace content | 755 } // namespace content |
OLD | NEW |