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

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

Issue 8804021: Proper management for policy-configured networks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 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 d03bf544f436ce28d7de4cff21a32aedafcb6d13..5ab2cdbf6da58adf24aa4023dae5463df8fe442c 100644
--- a/chrome/browser/policy/network_configuration_updater.cc
+++ b/chrome/browser/policy/network_configuration_updater.cc
@@ -10,6 +10,9 @@
namespace policy {
+const char NetworkConfigurationUpdater::kEmptyConfiguration[] =
+ "{NetworkConfigurations:[],Certificates:[]}";
+
NetworkConfigurationUpdater::NetworkConfigurationUpdater(
ConfigurationPolicyProvider* provider,
chromeos::NetworkLibrary* network_library)
@@ -57,6 +60,12 @@ void NetworkConfigurationUpdater::ApplyNetworkConfiguration(
LOG(WARNING) << "Invalid network configuration.";
}
+ // We need to load an empty configuration to get rid of any configuration
+ // that has been installed previously. An empty string also works, but
+ // generates warnings and errors, which we'd like to avoid.
+ if (new_network_config.empty())
+ new_network_config = kEmptyConfiguration;
+
if (*cached_value != new_network_config) {
*cached_value = new_network_config;
std::string error;
« no previous file with comments | « chrome/browser/policy/network_configuration_updater.h ('k') | chrome/browser/policy/network_configuration_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698