Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3320)

Unified Diff: chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.cc

Issue 12676017: Adding policy support to the new network configuration stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang errors. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.cc
diff --git a/chrome/browser/chromeos/policy/network_configuration_updater.cc b/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.cc
similarity index 86%
copy from chrome/browser/chromeos/policy/network_configuration_updater.cc
copy to chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.cc
index 3aca2a8f62c61b272c747738ed1bcfebc3bbf4b9..32bfc5a8a8a716f2448e8565c9243a52a83fdac1 100644
--- a/chrome/browser/chromeos/policy/network_configuration_updater.cc
+++ b/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/policy/network_configuration_updater.h"
+#include "chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.h"
#include <string>
@@ -53,7 +53,7 @@ class CrosTrustAnchorProvider : public net::CertTrustAnchorProvider {
} // namespace
-NetworkConfigurationUpdater::NetworkConfigurationUpdater(
+NetworkConfigurationUpdaterImplCros::NetworkConfigurationUpdaterImplCros(
PolicyService* policy_service,
chromeos::NetworkLibrary* network_library)
: policy_change_registrar_(
@@ -66,12 +66,12 @@ NetworkConfigurationUpdater::NetworkConfigurationUpdater(
DCHECK(network_library_);
policy_change_registrar_.Observe(
key::kDeviceOpenNetworkConfiguration,
- base::Bind(&NetworkConfigurationUpdater::OnPolicyChanged,
+ base::Bind(&NetworkConfigurationUpdaterImplCros::OnPolicyChanged,
base::Unretained(this),
chromeos::onc::ONC_SOURCE_DEVICE_POLICY));
policy_change_registrar_.Observe(
key::kOpenNetworkConfiguration,
- base::Bind(&NetworkConfigurationUpdater::OnPolicyChanged,
+ base::Bind(&NetworkConfigurationUpdaterImplCros::OnPolicyChanged,
base::Unretained(this),
chromeos::onc::ONC_SOURCE_USER_POLICY));
@@ -81,7 +81,7 @@ NetworkConfigurationUpdater::NetworkConfigurationUpdater(
ApplyNetworkConfigurations();
}
-NetworkConfigurationUpdater::~NetworkConfigurationUpdater() {
+NetworkConfigurationUpdaterImplCros::~NetworkConfigurationUpdaterImplCros() {
network_library_->RemoveNetworkProfileObserver(this);
bool posted = BrowserThread::DeleteSoon(
BrowserThread::IO, FROM_HERE, cert_trust_provider_);
@@ -89,24 +89,29 @@ NetworkConfigurationUpdater::~NetworkConfigurationUpdater() {
delete cert_trust_provider_;
}
-void NetworkConfigurationUpdater::OnProfileListChanged() {
+void NetworkConfigurationUpdaterImplCros::OnProfileListChanged() {
VLOG(1) << "Network profile list changed, applying policies.";
ApplyNetworkConfigurations();
}
-void NetworkConfigurationUpdater::OnUserPolicyInitialized() {
+void NetworkConfigurationUpdaterImplCros::OnUserPolicyInitialized() {
VLOG(1) << "User policy initialized, applying policies.";
user_policy_initialized_ = true;
ApplyNetworkConfigurations();
}
+void NetworkConfigurationUpdaterImplCros::
+set_allow_trusted_certificates_from_policy(bool allow) {
+ allow_trusted_certificates_from_policy_ = allow;
+}
+
net::CertTrustAnchorProvider*
- NetworkConfigurationUpdater::GetCertTrustAnchorProvider() {
+ NetworkConfigurationUpdaterImplCros::GetCertTrustAnchorProvider() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
return cert_trust_provider_;
}
-void NetworkConfigurationUpdater::OnPolicyChanged(
+void NetworkConfigurationUpdaterImplCros::OnPolicyChanged(
chromeos::onc::ONCSource onc_source,
const base::Value* previous,
const base::Value* current) {
@@ -115,7 +120,7 @@ void NetworkConfigurationUpdater::OnPolicyChanged(
ApplyNetworkConfigurations();
}
-void NetworkConfigurationUpdater::ApplyNetworkConfigurations() {
+void NetworkConfigurationUpdaterImplCros::ApplyNetworkConfigurations() {
ApplyNetworkConfiguration(key::kDeviceOpenNetworkConfiguration,
chromeos::onc::ONC_SOURCE_DEVICE_POLICY);
if (user_policy_initialized_) {
@@ -124,7 +129,7 @@ void NetworkConfigurationUpdater::ApplyNetworkConfigurations() {
}
}
-void NetworkConfigurationUpdater::ApplyNetworkConfiguration(
+void NetworkConfigurationUpdaterImplCros::ApplyNetworkConfiguration(
const std::string& policy_key,
chromeos::onc::ONCSource onc_source) {
VLOG(1) << "Apply policy for ONC source "

Powered by Google App Engine
This is Rietveld 408576698