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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 ? CONTENT_SETTINGS_TYPE_JAVASCRIPT | 752 ? CONTENT_SETTINGS_TYPE_JAVASCRIPT |
753 : CONTENT_SETTINGS_TYPE_PLUGINS; | 753 : CONTENT_SETTINGS_TYPE_PLUGINS; |
754 | 754 |
755 if ((status_value == | 755 if ((status_value == |
756 ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized || | 756 ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized || |
757 status_value == ChromeViewHostMsg_GetPluginInfo_Status::kBlocked) && | 757 status_value == ChromeViewHostMsg_GetPluginInfo_Status::kBlocked) && |
758 observer->IsPluginTemporarilyAllowed(identifier)) { | 758 observer->IsPluginTemporarilyAllowed(identifier)) { |
759 status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed; | 759 status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed; |
760 } | 760 } |
761 | 761 |
762 #if defined(ENABLE_PLUGINS) | |
763 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed && | |
764 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
765 switches::kEnablePluginPowerSaver)) { | |
766 status_value = | |
767 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent; | |
768 } | |
769 #endif | |
770 | |
771 #if defined(OS_WIN) | 762 #if defined(OS_WIN) |
772 // In Windows we need to check if we can load NPAPI plugins. | 763 // In Windows we need to check if we can load NPAPI plugins. |
773 // For example, if the render view is in the Ash desktop, we should not. | 764 // For example, if the render view is in the Ash desktop, we should not. |
774 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed && | 765 // If user is on ALLOW or DETECT setting, loading needs to be blocked here. |
| 766 if ((status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed || |
| 767 status_value == |
| 768 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) && |
775 info.type == content::WebPluginInfo::PLUGIN_TYPE_NPAPI) { | 769 info.type == content::WebPluginInfo::PLUGIN_TYPE_NPAPI) { |
776 if (observer->AreNPAPIPluginsBlocked()) | 770 if (observer->AreNPAPIPluginsBlocked()) |
777 status_value = | 771 status_value = |
778 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; | 772 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; |
779 } | 773 } |
780 #endif | 774 #endif |
781 | 775 |
782 auto create_blocked_plugin = | 776 auto create_blocked_plugin = |
783 [&render_frame, &frame, ¶ms, &info, &identifier, &group_name]( | 777 [&render_frame, &frame, ¶ms, &info, &identifier, &group_name]( |
784 int template_id, const base::string16& message) { | 778 int template_id, const base::string16& message) { |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 if (mime_type == content::kBrowserPluginMimeType) { | 1635 if (mime_type == content::kBrowserPluginMimeType) { |
1642 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1636 return new extensions::ExtensionsGuestViewContainer(render_frame); |
1643 } else { | 1637 } else { |
1644 return new extensions::MimeHandlerViewContainer( | 1638 return new extensions::MimeHandlerViewContainer( |
1645 render_frame, mime_type, original_url); | 1639 render_frame, mime_type, original_url); |
1646 } | 1640 } |
1647 #else | 1641 #else |
1648 return NULL; | 1642 return NULL; |
1649 #endif | 1643 #endif |
1650 } | 1644 } |
OLD | NEW |