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

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

Issue 876803005: Plugin Power Saver: --enable-plugin-power-saver only overrides ALLOW. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 } 695 }
696 696
697 // Allow full-screen plug-ins for left-click-to-play. 697 // Allow full-screen plug-ins for left-click-to-play.
698 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay && 698 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay &&
699 !frame->parent() && !frame->opener() && 699 !frame->parent() && !frame->opener() &&
700 frame->document().isPluginDocument()) { 700 frame->document().isPluginDocument()) {
701 status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed; 701 status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed;
702 } 702 }
703 703
704 #if defined(ENABLE_PLUGINS) 704 #if defined(ENABLE_PLUGINS)
705 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 705 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed &&
706 base::CommandLine::ForCurrentProcess()->HasSwitch(
706 switches::kEnablePluginPowerSaver)) { 707 switches::kEnablePluginPowerSaver)) {
707 status_value = 708 status_value =
708 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent; 709 ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent;
709 } 710 }
710 #endif 711 #endif
711 712
712 #if defined(OS_WIN) 713 #if defined(OS_WIN)
713 // In Windows we need to check if we can load NPAPI plugins. 714 // In Windows we need to check if we can load NPAPI plugins.
714 // For example, if the render view is in the Ash desktop, we should not. 715 // For example, if the render view is in the Ash desktop, we should not.
715 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed && 716 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed &&
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 if (mime_type == content::kBrowserPluginMimeType) { 1590 if (mime_type == content::kBrowserPluginMimeType) {
1590 return new extensions::ExtensionsGuestViewContainer(render_frame); 1591 return new extensions::ExtensionsGuestViewContainer(render_frame);
1591 } else { 1592 } else {
1592 return new extensions::MimeHandlerViewContainer( 1593 return new extensions::MimeHandlerViewContainer(
1593 render_frame, mime_type, original_url); 1594 render_frame, mime_type, original_url);
1594 } 1595 }
1595 #else 1596 #else
1596 return NULL; 1597 return NULL;
1597 #endif 1598 #endif
1598 } 1599 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698