| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/user_network_configuration_updater_fact
ory.h" | 5 #include "chrome/browser/chromeos/policy/user_network_configuration_updater_fact
ory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/chromeos/login/user.h" | 8 #include "chrome/browser/chromeos/login/user.h" |
| 9 #include "chrome/browser/chromeos/login/user_manager.h" | 9 #include "chrome/browser/chromeos/login/user_manager.h" |
| 10 #include "chrome/browser/chromeos/policy/user_network_configuration_updater.h" | 10 #include "chrome/browser/chromeos/policy/user_network_configuration_updater.h" |
| 11 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 11 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 12 #include "chrome/browser/policy/profile_policy_connector.h" | 12 #include "chrome/browser/policy/profile_policy_connector.h" |
| 13 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 13 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 14 #include "chrome/browser/profiles/incognito_helpers.h" | 14 #include "chrome/browser/profiles/incognito_helpers.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "chromeos/network/network_handler.h" | 17 #include "chromeos/network/network_handler.h" |
| 18 #include "chromeos/network/onc/onc_certificate_importer_impl.h" | |
| 19 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 18 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 20 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 19 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 21 | 20 |
| 22 namespace policy { | 21 namespace policy { |
| 23 | 22 |
| 24 // static | 23 // static |
| 25 UserNetworkConfigurationUpdater* | 24 UserNetworkConfigurationUpdater* |
| 26 UserNetworkConfigurationUpdaterFactory::GetForProfile(Profile* profile) { | 25 UserNetworkConfigurationUpdaterFactory::GetForProfile(Profile* profile) { |
| 27 return static_cast<UserNetworkConfigurationUpdater*>( | 26 return static_cast<UserNetworkConfigurationUpdater*>( |
| 28 GetInstance()->GetServiceForBrowserContext(profile, true)); | 27 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 if (user != user_manager->GetPrimaryUser()) | 74 if (user != user_manager->GetPrimaryUser()) |
| 76 return NULL; | 75 return NULL; |
| 77 | 76 |
| 78 const bool allow_trusted_certs_from_policy = | 77 const bool allow_trusted_certs_from_policy = |
| 79 user->GetType() == chromeos::User::USER_TYPE_REGULAR; | 78 user->GetType() == chromeos::User::USER_TYPE_REGULAR; |
| 80 | 79 |
| 81 ProfilePolicyConnector* profile_connector = | 80 ProfilePolicyConnector* profile_connector = |
| 82 ProfilePolicyConnectorFactory::GetForProfile(profile); | 81 ProfilePolicyConnectorFactory::GetForProfile(profile); |
| 83 | 82 |
| 84 return UserNetworkConfigurationUpdater::CreateForUserPolicy( | 83 return UserNetworkConfigurationUpdater::CreateForUserPolicy( |
| 84 profile, |
| 85 allow_trusted_certs_from_policy, | 85 allow_trusted_certs_from_policy, |
| 86 *user, | 86 *user, |
| 87 scoped_ptr<chromeos::onc::CertificateImporter>( | |
| 88 new chromeos::onc::CertificateImporterImpl), | |
| 89 profile_connector->policy_service(), | 87 profile_connector->policy_service(), |
| 90 chromeos::NetworkHandler::Get()->managed_network_configuration_handler()) | 88 chromeos::NetworkHandler::Get()->managed_network_configuration_handler()) |
| 91 .release(); | 89 .release(); |
| 92 } | 90 } |
| 93 | 91 |
| 94 } // namespace policy | 92 } // namespace policy |
| OLD | NEW |