Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1084)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1033103002: Plugin Power Saver: Overhaul plugin-power-saver flags. Show in UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gypi i hope Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 ||
groby-ooo-7-16 2015/03/27 23:12:32 Should we just send the right value from the brows
tommycli 2015/03/28 00:40:04 In this particular case, we are sending the right
766 status_value ==
767 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) &&
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, &params, &info, &identifier, &group_name]( 776 [&render_frame, &frame, &params, &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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698