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 "chrome/browser/plugins/plugin_info_message_filter.h" | 5 #include "chrome/browser/plugins/plugin_info_message_filter.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 // If we broke out of the loop, we have found an enabled plugin. | 492 // If we broke out of the loop, we have found an enabled plugin. |
493 bool enabled = i < matching_plugins.size(); | 493 bool enabled = i < matching_plugins.size(); |
494 if (!enabled) { | 494 if (!enabled) { |
495 // Otherwise, we only found disabled plugins, so we take the first one. | 495 // Otherwise, we only found disabled plugins, so we take the first one. |
496 i = 0; | 496 i = 0; |
497 *status = ChromeViewHostMsg_GetPluginInfo_Status::kDisabled; | 497 *status = ChromeViewHostMsg_GetPluginInfo_Status::kDisabled; |
498 | 498 |
499 if (PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map_) && | 499 if (PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map_) && |
500 matching_plugins[0].name == | 500 matching_plugins[0].name == |
501 base::ASCIIToUTF16(content::kFlashPluginName)) { | 501 base::ASCIIToUTF16(content::kFlashPluginName)) { |
502 // TODO(tommycli): This assumes that Flash can no longer be disabled | |
503 // via chrome://plugins. That should be fine since chrome://plugins is | |
504 // going away, but we should verify before launching HBD. | |
505 *status = ChromeViewHostMsg_GetPluginInfo_Status::kFlashHiddenPreferHtml; | 502 *status = ChromeViewHostMsg_GetPluginInfo_Status::kFlashHiddenPreferHtml; |
506 | 503 |
507 // In the Prefer HTML case, the plugin is actually enabled, but hidden. | 504 // In the Prefer HTML case, the plugin is actually enabled, but hidden. |
508 // It will still be blocked in the body of DecidePluginStatus. | 505 // It will still be blocked in the body of DecidePluginStatus. |
509 enabled = true; | 506 enabled = true; |
510 } | 507 } |
511 } | 508 } |
512 | 509 |
513 *plugin = matching_plugins[i]; | 510 *plugin = matching_plugins[i]; |
514 *actual_mime_type = mime_types[i]; | 511 *actual_mime_type = mime_types[i]; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 status == ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) { | 566 status == ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) { |
570 ChromePluginServiceFilter::GetInstance()->AuthorizePlugin( | 567 ChromePluginServiceFilter::GetInstance()->AuthorizePlugin( |
571 render_process_id_, path); | 568 render_process_id_, path); |
572 } | 569 } |
573 } | 570 } |
574 | 571 |
575 bool PluginInfoMessageFilter::Context::IsPluginEnabled( | 572 bool PluginInfoMessageFilter::Context::IsPluginEnabled( |
576 const content::WebPluginInfo& plugin) const { | 573 const content::WebPluginInfo& plugin) const { |
577 return plugin_prefs_->IsPluginEnabled(plugin); | 574 return plugin_prefs_->IsPluginEnabled(plugin); |
578 } | 575 } |
OLD | NEW |