Remove BrowserMainParts::ServiceManagerConnectionStarted

This is no longer necessary since the Service Manager is initialized
before browser threads are even created. None of the implementations
of this override needed the ServiceManagerConnection specifically,
but only its Connector. Additionally, with recent changes to Service
Manager initialization the PostCreateThreads() method is effectively
equivalent in timing to what ServiceManagerConnectionStarted was.

As such all prior implementations of ServiceManagerConnectionStarted
have been moved into a PostCreateThreads override, and references to
the connection argument have been replaced with GetSystemConnector().

Bug: 904240
Change-Id: I70a445f5dcf9d16df654b95d971672f8c611e108
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1652798
Commit-Queue: Ken Rockot <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Erik Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#669025}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index e83f7b0..edb060d 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -1143,6 +1143,8 @@
       extensions::kExtensionScheme, true);
 #endif
 
+  battery_metrics_ = std::make_unique<BatteryMetrics>();
+
   secure_origin_prefs_observer_ =
       std::make_unique<SecureOriginPrefsObserver>(local_state());
   site_isolation_prefs_observer_ =
@@ -1174,12 +1176,6 @@
   io_thread_ = std::make_unique<IOThread>(net_log_.get());
 }
 
-void BrowserProcessImpl::ServiceManagerConnectionStarted(
-    content::ServiceManagerConnection* connection) {
-  // This uses the service manager so it must happen after it's started.
-  battery_metrics_ = std::make_unique<BatteryMetrics>();
-}
-
 void BrowserProcessImpl::PreMainMessageLoopRun() {
   TRACE_EVENT0("startup", "BrowserProcessImpl::PreMainMessageLoopRun");
   SCOPED_UMA_HISTOGRAM_TIMER(