Remove a few more message_center.h includes in chrome/.

- don't create a NotificationUIManager if there's no message center
  (for now there's always a MessageCenter in the browser process,
   but that will change, and in the meantime some unit tests can now
   stop instantiating the MessageCenter)
- remove BrowserProcess::message_center(), inline the singleton getter

Bug: 578868
Change-Id: Ifdfa7524bef73fc2cf93fbc99ba624edfe8d9027
Reviewed-on: https://chromium-review.googlesource.com/896703
Reviewed-by: Peter Beverloo <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Evan Stade <[email protected]>
Cr-Commit-Position: refs/heads/master@{#535889}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 152ee25..05f2016 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -264,6 +264,8 @@
   extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get());
 #endif
 
+  // TODO(estade): don't initialize the MessageCenter until we know it's needed
+  // (i.e. because a NotificationPlatformBridgeMessageCenter has been created).
   message_center::MessageCenter::Initialize();
 
   update_client::UpdateQueryParams::SetDelegate(
@@ -677,11 +679,6 @@
 #endif
 }
 
-message_center::MessageCenter* BrowserProcessImpl::message_center() {
-  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-  return message_center::MessageCenter::Get();
-}
-
 policy::ChromeBrowserPolicyConnector*
 BrowserProcessImpl::browser_policy_connector() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -1187,7 +1184,7 @@
 #if !defined(OS_ANDROID)
   DCHECK(!notification_ui_manager_);
   notification_ui_manager_.reset(NotificationUIManager::Create());
-  created_notification_ui_manager_ = true;
+  created_notification_ui_manager_ = !!notification_ui_manager_;
 #endif
 }