Use BUILDFLAG(ENABLE_PLUGINS) in core chrome/ browser classes.

Guard plugin code with BUILDFLAG(ENABLE_PLUGINS). Fix some nits along
the way.

Bug: 1027360
Change-Id: I04fea4b38dfe98b0356eca1d0526493ab2faec79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962901
Reviewed-by: Joshua Pawlicki <[email protected]>
Commit-Queue: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#723955}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 2a448f4..74cfdc7d 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -59,8 +59,6 @@
 #include "chrome/browser/net/system_network_context_manager.h"
 #include "chrome/browser/notifications/notification_platform_bridge.h"
 #include "chrome/browser/notifications/system_notification_helper.h"
-#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
-#include "chrome/browser/plugins/plugin_finder.h"
 #include "chrome/browser/policy/chrome_browser_policy_connector.h"
 #include "chrome/browser/prefs/browser_prefs.h"
 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
@@ -122,7 +120,6 @@
 #include "content/public/browser/network_quality_observer_factory.h"
 #include "content/public/browser/network_service_instance.h"
 #include "content/public/browser/notification_details.h"
-#include "content/public/browser/plugin_service.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/service_worker_context.h"
 #include "content/public/browser/storage_partition.h"
@@ -145,6 +142,7 @@
 #include "base/win/windows_version.h"
 #elif defined(OS_MACOSX)
 #include "chrome/browser/chrome_browser_main_mac.h"
+#include "chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h"
 #endif
 
 #if !defined(OS_CHROMEOS)
@@ -156,6 +154,7 @@
 #include "chrome/browser/android/component_updater/background_task_update_scheduler.h"
 #else
 #include "chrome/browser/gcm/gcm_product_util.h"
+#include "chrome/browser/resource_coordinator/tab_manager.h"
 #include "chrome/browser/ui/browser_finder.h"
 #include "components/gcm_driver/gcm_client_factory.h"
 #include "components/gcm_driver/gcm_desktop_utils.h"
@@ -178,11 +177,10 @@
 #endif
 
 #if BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
+#include "chrome/browser/plugins/plugin_finder.h"
 #include "chrome/browser/plugins/plugins_resource_service.h"
-#endif
-
-#if !defined(OS_ANDROID)
-#include "chrome/browser/resource_coordinator/tab_manager.h"
+#include "content/public/browser/plugin_service.h"
 #endif
 
 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
@@ -191,10 +189,6 @@
 #include "chrome/browser/ui/user_manager.h"
 #endif
 
-#if defined(OS_MACOSX)
-#include "chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h"
-#endif
-
 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h"
 #endif
@@ -216,7 +210,6 @@
 
 using content::BrowserThread;
 using content::ChildProcessSecurityPolicy;
-using content::PluginService;
 
 rappor::RapporService* GetBrowserRapporService() {
   if (g_browser_process != nullptr)
@@ -1129,7 +1122,7 @@
 #endif
 
 #if BUILDFLAG(ENABLE_PLUGINS)
-  PluginService* plugin_service = PluginService::GetInstance();
+  auto* plugin_service = content::PluginService::GetInstance();
   plugin_service->SetFilter(ChromePluginServiceFilter::GetInstance());
 
   // Triggers initialization of the singleton instance on UI thread.