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 ((status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed || |
766 status_value == | |
767 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) && | |
Lei Zhang
2015/03/30 18:45:31
Can you add a comment to explain why this is here?
tommycli
2015/03/30 18:59:43
Done.
| |
775 info.type == content::WebPluginInfo::PLUGIN_TYPE_NPAPI) { | 768 info.type == content::WebPluginInfo::PLUGIN_TYPE_NPAPI) { |
776 if (observer->AreNPAPIPluginsBlocked()) | 769 if (observer->AreNPAPIPluginsBlocked()) |
777 status_value = | 770 status_value = |
778 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; | 771 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; |
779 } | 772 } |
780 #endif | 773 #endif |
781 | 774 |
782 auto create_blocked_plugin = | 775 auto create_blocked_plugin = |
783 [&render_frame, &frame, ¶ms, &info, &identifier, &group_name]( | 776 [&render_frame, &frame, ¶ms, &info, &identifier, &group_name]( |
784 int template_id, const base::string16& message) { | 777 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) { | 1634 if (mime_type == content::kBrowserPluginMimeType) { |
1642 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1635 return new extensions::ExtensionsGuestViewContainer(render_frame); |
1643 } else { | 1636 } else { |
1644 return new extensions::MimeHandlerViewContainer( | 1637 return new extensions::MimeHandlerViewContainer( |
1645 render_frame, mime_type, original_url); | 1638 render_frame, mime_type, original_url); |
1646 } | 1639 } |
1647 #else | 1640 #else |
1648 return NULL; | 1641 return NULL; |
1649 #endif | 1642 #endif |
1650 } | 1643 } |
OLD | NEW |