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

Unified Diff: chrome/browser/policy/network_configuration_updater.cc

Issue 11578005: Rejecting networks/certificates independently on ONC import and policy loading. (Closed) Base URL: http://git.chromium.org/chromium/src.git@reject_network_independently
Patch Set: Addressed Steven's comment. Created 8 years 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/policy/network_configuration_updater.cc
diff --git a/chrome/browser/policy/network_configuration_updater.cc b/chrome/browser/policy/network_configuration_updater.cc
index 55c450295fbb6bc289bba6a0966505b9546c0f6d..0421f66da55a0b303750b1ff6bfc2f2d0cdcaa5e 100644
--- a/chrome/browser/policy/network_configuration_updater.cc
+++ b/chrome/browser/policy/network_configuration_updater.cc
@@ -53,7 +53,7 @@ void NetworkConfigurationUpdater::OnProfileListChanged() {
}
void NetworkConfigurationUpdater::OnUserPolicyInitialized() {
- VLOG(1) << "User policy initialized, applying policies. Ignoring.";
+ VLOG(1) << "User policy initialized, applying policies.";
user_policy_initialized_ = true;
ApplyNetworkConfigurations();
}
@@ -62,7 +62,8 @@ void NetworkConfigurationUpdater::OnPolicyChanged(
chromeos::onc::ONCSource onc_source,
const base::Value* previous,
const base::Value* current) {
- VLOG(1) << "Policy for ONC source " << onc_source << " changed.";
+ VLOG(1) << "Policy for ONC source "
+ << chromeos::onc::GetSourceAsString(onc_source) << " changed.";
ApplyNetworkConfigurations();
}
@@ -78,7 +79,8 @@ void NetworkConfigurationUpdater::ApplyNetworkConfigurations() {
void NetworkConfigurationUpdater::ApplyNetworkConfiguration(
const std::string& policy_key,
chromeos::onc::ONCSource onc_source) {
- VLOG(1) << "Apply policy for ONC source " << onc_source;
+ VLOG(1) << "Apply policy for ONC source "
+ << chromeos::onc::GetSourceAsString(onc_source);
const PolicyMap& policies = policy_service_->GetPolicies(POLICY_DOMAIN_CHROME,
std::string());
const base::Value* policy_value = policies.GetValue(policy_key);
@@ -87,8 +89,11 @@ void NetworkConfigurationUpdater::ApplyNetworkConfiguration(
if (policy_value != NULL) {
// If the policy is not a string, we issue a warning, but still clear the
// network configuration.
- if (!policy_value->GetAsString(&new_network_config))
- LOG(WARNING) << "ONC policy is not a string value.";
+ if (!policy_value->GetAsString(&new_network_config)) {
+ LOG(WARNING) << "ONC policy for source "
+ << chromeos::onc::GetSourceAsString(onc_source)
+ << " is not a string value.";
+ }
}
// An empty string is not a valid ONC and generates warnings and
@@ -96,8 +101,10 @@ void NetworkConfigurationUpdater::ApplyNetworkConfiguration(
if (new_network_config.empty())
new_network_config = chromeos::onc::kEmptyUnencryptedConfiguration;
- network_library_->LoadOncNetworks(new_network_config, "", onc_source,
- allow_web_trust_);
+ if (!network_library_->LoadOncNetworks(new_network_config, "", onc_source,
+ allow_web_trust_)) {
+ LOG(ERROR) << "Errors occurred during the ONC policy application.";
+ }
}
} // namespace policy
« no previous file with comments | « chrome/browser/chromeos/cros/network_library_impl_base.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698