Index: chrome/browser/chromeos/login/login_utils.cc |
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc |
index 2feb04c21c0f9c7234a8bcff381e621c018d0756..08ce5246246c21e656cbec84efd92211b1fad86a 100644 |
--- a/chrome/browser/chromeos/login/login_utils.cc |
+++ b/chrome/browser/chromeos/login/login_utils.cc |
@@ -47,6 +47,7 @@ |
#include "chrome/browser/chromeos/net/connectivity_state_helper.h" |
#include "chrome/browser/chromeos/net/connectivity_state_helper_observer.h" |
#include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
+#include "chrome/browser/chromeos/policy/network_configuration_updater2.h" |
#include "chrome/browser/chromeos/settings/cros_settings.h" |
#include "chrome/browser/chromeos/settings/cros_settings_names.h" |
#include "chrome/browser/extensions/extension_service.h" |
@@ -73,6 +74,7 @@ |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/logging_chrome.h" |
#include "chrome/common/pref_names.h" |
+#include "chromeos/chromeos_switches.h" |
#include "chromeos/dbus/dbus_thread_manager.h" |
#include "chromeos/dbus/session_manager_client.h" |
#include "content/public/browser/browser_thread.h" |
@@ -427,11 +429,17 @@ void LoginUtilsImpl::InitProfilePreferences(Profile* user_profile) { |
// Locally managed users do not have user policy initialized. |
if (!UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { |
- policy::NetworkConfigurationUpdater* network_configuration_updater = |
- g_browser_process->browser_policy_connector()-> |
- GetNetworkConfigurationUpdater(); |
- if (network_configuration_updater) |
- network_configuration_updater->OnUserPolicyInitialized(); |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kUseNewNetworkConfigurationHandlers)) { |
+ g_browser_process->browser_policy_connector()-> |
+ GetNetworkConfigurationUpdater2()->OnUserPolicyInitialized(); |
+ } else { |
+ policy::NetworkConfigurationUpdater* network_configuration_updater = |
+ g_browser_process->browser_policy_connector()-> |
+ GetNetworkConfigurationUpdater(); |
+ if (network_configuration_updater) |
+ network_configuration_updater->OnUserPolicyInitialized(); |
+ } |
} |
RespectLocalePreference(user_profile); |