Run all flag-checks for new-profile-managment et al through common functions for future Finch integration.

In order to do tests and a safe, controlled roll-out of Chrome's new profile management, we're going to enable it using a Finch experiment.  The current tests of the existing command-line flags all need to be routed through common functions in order to override these settings if a Finch experiment is set.

Affected flags are:
  --new-profile-management
  --enable-inline-signin
  --google-profile-info

Note that there existed a function to test for NewProfileManagement but it was not in a good place for general testing and definitely not for other flags so it has been extracted as well.

BUG=324046

Review URL: https://codereview.chromium.org/108803007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241698 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index a79c5c2..f10bfae7 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -60,7 +60,6 @@
 #include "chrome/browser/printing/print_job_manager.h"
 #include "chrome/browser/printing/print_preview_dialog_controller.h"
 #include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/profiles/profiles_state.h"
 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h"
 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
 #include "chrome/browser/shell_integration.h"
@@ -77,6 +76,7 @@
 #include "chrome/common/extensions/chrome_extensions_client.h"
 #include "chrome/common/extensions/extension_l10n_util.h"
 #include "chrome/common/pref_names.h"
+#include "chrome/common/profile_management_switches.h"
 #include "chrome/common/switch_utils.h"
 #include "chrome/common/url_constants.h"
 #include "chrome/installer/util/google_update_constants.h"
@@ -252,7 +252,7 @@
                  "BrowserProcessImpl::StartTearDown:ProfileManager");
     // The desktop User Manager needs to be closed before the guest profile
     // can be destroyed.
-    if (profiles::IsNewProfileManagementEnabled())
+    if (switches::IsNewProfileManagement())
       chrome::HideUserManager();
     profile_manager_.reset();
   }