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

Side by Side Diff: content/browser/plugin_service_impl.cc

Issue 1240543003: Remove NPAPI command line flags entirely. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « content/browser/plugin_browsertest.cc ('k') | content/public/browser/content_browser_client.h » ('j') | 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 "content/browser/plugin_service_impl.h" 5 #include "content/browser/plugin_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 void PluginServiceImpl::UnregisterInternalPlugin(const base::FilePath& path) { 787 void PluginServiceImpl::UnregisterInternalPlugin(const base::FilePath& path) {
788 PluginList::Singleton()->UnregisterInternalPlugin(path); 788 PluginList::Singleton()->UnregisterInternalPlugin(path);
789 } 789 }
790 790
791 void PluginServiceImpl::GetInternalPlugins( 791 void PluginServiceImpl::GetInternalPlugins(
792 std::vector<WebPluginInfo>* plugins) { 792 std::vector<WebPluginInfo>* plugins) {
793 PluginList::Singleton()->GetInternalPlugins(plugins); 793 PluginList::Singleton()->GetInternalPlugins(plugins);
794 } 794 }
795 795
796 bool PluginServiceImpl::NPAPIPluginsSupported() { 796 bool PluginServiceImpl::NPAPIPluginsSupported() {
797 static bool command_line_checked = false;
798
799 if (!command_line_checked) {
800 #if defined(OS_WIN) || defined(OS_MACOSX) 797 #if defined(OS_WIN) || defined(OS_MACOSX)
801 const base::CommandLine* command_line = 798 npapi_plugins_enabled_ =
802 base::CommandLine::ForCurrentProcess(); 799 content::GetContentClient()->browser()->IsNPAPIEnabled();
jam 2015/07/20 16:36:22 nit: no content::
Will Harris 2015/07/20 16:54:50 Done, also below where I stole this from :)
803 npapi_plugins_enabled_ =
804 command_line->HasSwitch(switches::kEnableNpapiForTesting);
805 #if defined(OS_WIN) 800 #if defined(OS_WIN)
806 // NPAPI plugins don't play well with Win32k renderer lockdown. 801 // NPAPI plugins don't play well with Win32k renderer lockdown.
807 if (npapi_plugins_enabled_) 802 if (npapi_plugins_enabled_)
808 DisableWin32kRendererLockdown(); 803 DisableWin32kRendererLockdown();
809 #endif 804 #endif
810 NPAPIPluginStatus status = 805 NPAPIPluginStatus status =
811 npapi_plugins_enabled_ ? NPAPI_STATUS_ENABLED : NPAPI_STATUS_DISABLED; 806 npapi_plugins_enabled_ ? NPAPI_STATUS_ENABLED : NPAPI_STATUS_DISABLED;
812 #else 807 #else
813 NPAPIPluginStatus status = NPAPI_STATUS_UNSUPPORTED; 808 NPAPIPluginStatus status = NPAPI_STATUS_UNSUPPORTED;
814 #endif 809 #endif
815 UMA_HISTOGRAM_ENUMERATION("Plugin.NPAPIStatus", status, 810 UMA_HISTOGRAM_ENUMERATION("Plugin.NPAPIStatus", status,
816 NPAPI_STATUS_ENUM_COUNT); 811 NPAPI_STATUS_ENUM_COUNT);
817 }
818 812
819 return npapi_plugins_enabled_; 813 return npapi_plugins_enabled_;
820 } 814 }
821 815
822 void PluginServiceImpl::DisablePluginsDiscoveryForTesting() { 816 void PluginServiceImpl::DisablePluginsDiscoveryForTesting() {
823 PluginList::Singleton()->DisablePluginsDiscovery(); 817 PluginList::Singleton()->DisablePluginsDiscovery();
824 } 818 }
825 819
826 #if defined(OS_MACOSX) 820 #if defined(OS_MACOSX)
827 void PluginServiceImpl::AppActivated() { 821 void PluginServiceImpl::AppActivated() {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 #endif 865 #endif
872 866
873 bool PluginServiceImpl::PpapiDevChannelSupported( 867 bool PluginServiceImpl::PpapiDevChannelSupported(
874 BrowserContext* browser_context, 868 BrowserContext* browser_context,
875 const GURL& document_url) { 869 const GURL& document_url) {
876 return content::GetContentClient()->browser()-> 870 return content::GetContentClient()->browser()->
877 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url); 871 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url);
878 } 872 }
879 873
880 } // namespace content 874 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_browsertest.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698