Index: chrome/browser/policy/browser_policy_connector.cc |
diff --git a/chrome/browser/policy/browser_policy_connector.cc b/chrome/browser/policy/browser_policy_connector.cc |
index 997e1870caac9d25aebad7d386cd29ac74d103cb..0aae5297f1a29a798c86ff0ce93a248235081a45 100644 |
--- a/chrome/browser/policy/browser_policy_connector.cc |
+++ b/chrome/browser/policy/browser_policy_connector.cc |
@@ -58,6 +58,8 @@ |
#include "chrome/browser/chromeos/policy/device_status_collector.h" |
#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" |
#include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
+#include "chrome/browser/chromeos/policy/network_configuration_updater_impl.h" |
+#include "chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.h" |
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
#include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" |
#include "chrome/browser/chromeos/settings/cros_settings.h" |
@@ -66,6 +68,7 @@ |
#include "chrome/browser/chromeos/system/statistics_provider.h" |
#include "chrome/browser/chromeos/system/timezone_settings.h" |
#include "chrome/browser/policy/cloud/resource_cache.h" |
+#include "chromeos/chromeos_switches.h" |
#include "chromeos/dbus/cryptohome_client.h" |
#include "chromeos/dbus/dbus_thread_manager.h" |
#else |
@@ -304,11 +307,17 @@ void BrowserPolicyConnector::InitializeUserPolicy( |
const std::string& user_name, |
bool is_public_account, |
bool wait_for_policy_fetch) { |
+ CommandLine* command_line = CommandLine::ForCurrentProcess(); |
+ |
// If the user is managed then importing certificates from ONC policy is |
// allowed, otherwise it's not. Update this flag once the user has signed in, |
// and before user policy is loaded. |
- GetNetworkConfigurationUpdater()->set_allow_trusted_certificates_from_policy( |
- GetUserAffiliation(user_name) == USER_AFFILIATION_MANAGED); |
+ if (!command_line->HasSwitch( |
+ chromeos::switches::kUseNewNetworkConfigurationHandlers)) { |
+ GetNetworkConfigurationUpdater()-> |
+ set_allow_trusted_certificates_from_policy( |
+ GetUserAffiliation(user_name) == USER_AFFILIATION_MANAGED); |
+ } |
// Re-initializing user policy is disallowed for two reasons: |
// (a) Existing profiles may hold pointers to |user_cloud_policy_manager_|. |
@@ -316,8 +325,6 @@ void BrowserPolicyConnector::InitializeUserPolicy( |
// correctly is impossible for re-initialization. |
CHECK(!user_cloud_policy_manager_); |
- CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- |
base::FilePath profile_dir; |
CHECK(PathService::Get(chrome::DIR_USER_DATA, &profile_dir)); |
profile_dir = profile_dir.Append( |
@@ -396,9 +403,17 @@ AppPackUpdater* BrowserPolicyConnector::GetAppPackUpdater() { |
NetworkConfigurationUpdater* |
BrowserPolicyConnector::GetNetworkConfigurationUpdater() { |
if (!network_configuration_updater_) { |
- network_configuration_updater_.reset(new NetworkConfigurationUpdater( |
- GetPolicyService(), |
- chromeos::CrosLibrary::Get()->GetNetworkLibrary())); |
+ CommandLine* command_line = CommandLine::ForCurrentProcess(); |
+ if (command_line->HasSwitch( |
+ chromeos::switches::kUseNewNetworkConfigurationHandlers)) { |
+ network_configuration_updater_.reset(new NetworkConfigurationUpdaterImpl( |
pastarmovj
2013/04/16 11:31:18
nit: I think it will be more easily readable if yo
pneubeck (no reviews)
2013/04/16 14:56:28
Done.
|
+ GetPolicyService())); |
+ } else { |
+ network_configuration_updater_.reset( |
+ new NetworkConfigurationUpdaterImplCros( |
+ GetPolicyService(), |
+ chromeos::CrosLibrary::Get()->GetNetworkLibrary())); |
+ } |
} |
return network_configuration_updater_.get(); |
} |