summaryrefslogtreecommitdiffstats
path: root/chromeos/network/managed_network_configuration_handler_impl.cc
diff options
context:
space:
mode:
authorstevenjb <stevenjb@chromium.org>2015-02-19 16:52:43 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-20 00:53:29 +0000
commitada74bf691606e7bf01e22810770f6e9229c58a8 (patch)
tree0ee6649246aff63f87df79c59e5fac8afc87183e /chromeos/network/managed_network_configuration_handler_impl.cc
parent9117ee01cd00abbb78482cefc5d0640047a830b4 (diff)
downloadchromium_src-ada74bf691606e7bf01e22810770f6e9229c58a8.zip
chromium_src-ada74bf691606e7bf01e22810770f6e9229c58a8.tar.gz
chromium_src-ada74bf691606e7bf01e22810770f6e9229c58a8.tar.bz2
Use ManagednetworkConfigurationHandler where possible, add 'Shill' to NCH methods
This renames NetworkConfigurationHandler::Get/SetProperties and NetworkConfigurationHandler::CreateConfiguration to include 'Shill' in the name to make it clear that they are taking Shill properties instead of ONC. Also adds a comment to encourage use of MNCH. BUG=457936 For renaming change to wifi_access_point_info_provider_chromeos.cc: TBR=isherman@chromium.org Review URL: https://codereview.chromium.org/917393002 Cr-Commit-Position: refs/heads/master@{#317198}
Diffstat (limited to 'chromeos/network/managed_network_configuration_handler_impl.cc')
-rw-r--r--chromeos/network/managed_network_configuration_handler_impl.cc37
1 files changed, 14 insertions, 23 deletions
diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc
index be67c52..424e9d2 100644
--- a/chromeos/network/managed_network_configuration_handler_impl.cc
+++ b/chromeos/network/managed_network_configuration_handler_impl.cc
@@ -51,8 +51,7 @@ const char kInvalidUserSettings[] = "InvalidUserSettings";
const char kNetworkAlreadyConfigured[] = "NetworkAlreadyConfigured";
const char kPoliciesNotInitialized[] = "PoliciesNotInitialized";
const char kProfileNotInitialized[] = "ProfileNotInitialized";
-const char kSetOnUnconfiguredNetwork[] = "SetCalledOnUnconfiguredNetwork";
-const char kUnknownProfilePath[] = "UnknownProfilePath";
+const char kUnconfiguredNetwork[] = "UnconfiguredNetwork";
const char kUnknownNetwork[] = "UnknownNetwork";
std::string ToDebugString(::onc::ONCSource source,
@@ -120,16 +119,14 @@ void ManagedNetworkConfigurationHandlerImpl::GetManagedProperties(
InvokeErrorCallback(service_path, error_callback, kPoliciesNotInitialized);
return;
}
- network_configuration_handler_->GetProperties(
+ network_configuration_handler_->GetShillProperties(
service_path,
base::Bind(
&ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback,
weak_ptr_factory_.GetWeakPtr(),
base::Bind(
&ManagedNetworkConfigurationHandlerImpl::SendManagedProperties,
- weak_ptr_factory_.GetWeakPtr(),
- userhash,
- callback,
+ weak_ptr_factory_.GetWeakPtr(), userhash, callback,
error_callback)),
error_callback);
}
@@ -200,15 +197,13 @@ void ManagedNetworkConfigurationHandlerImpl::GetProperties(
const std::string& service_path,
const network_handler::DictionaryResultCallback& callback,
const network_handler::ErrorCallback& error_callback) {
- network_configuration_handler_->GetProperties(
+ network_configuration_handler_->GetShillProperties(
service_path,
base::Bind(
&ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback,
weak_ptr_factory_.GetWeakPtr(),
base::Bind(&ManagedNetworkConfigurationHandlerImpl::SendProperties,
- weak_ptr_factory_.GetWeakPtr(),
- callback,
- error_callback)),
+ weak_ptr_factory_.GetWeakPtr(), callback, error_callback)),
error_callback);
}
@@ -240,20 +235,16 @@ void ManagedNetworkConfigurationHandlerImpl::SetProperties(
}
std::string guid = state->guid();
- if (guid.empty()) {
- // TODO(pneubeck): create an initial configuration in this case. As for
- // CreateConfiguration, user settings from older ChromeOS versions have to
- // determined here.
- InvokeErrorCallback(
- service_path, error_callback, kSetOnUnconfiguredNetwork);
- return;
- }
+ DCHECK(!guid.empty());
const std::string& profile_path = state->profile_path();
const NetworkProfile *profile =
network_profile_handler_->GetProfileForPath(profile_path);
if (!profile) {
- InvokeErrorCallback(service_path, error_callback, kUnknownProfilePath);
+ // TODO(pneubeck): create an initial configuration in this case. As for
+ // CreateConfiguration, user settings from older ChromeOS versions have to
+ // be determined here.
+ InvokeErrorCallback(service_path, error_callback, kUnconfiguredNetwork);
return;
}
@@ -313,7 +304,7 @@ void ManagedNetworkConfigurationHandlerImpl::SetProperties(
network_policy,
validated_user_settings.get()));
- network_configuration_handler_->SetProperties(
+ network_configuration_handler_->SetShillProperties(
service_path, *shill_dictionary,
NetworkConfigurationObserver::SOURCE_USER_ACTION, callback,
error_callback);
@@ -357,7 +348,7 @@ void ManagedNetworkConfigurationHandlerImpl::CreateConfiguration(
NULL, // no network policy
&properties));
- network_configuration_handler_->CreateConfiguration(
+ network_configuration_handler_->CreateShillConfiguration(
*shill_dictionary, NetworkConfigurationObserver::SOURCE_USER_ACTION,
callback, error_callback);
}
@@ -503,7 +494,7 @@ void ManagedNetworkConfigurationHandlerImpl::OnProfileRemoved(
void ManagedNetworkConfigurationHandlerImpl::CreateConfigurationFromPolicy(
const base::DictionaryValue& shill_properties) {
- network_configuration_handler_->CreateConfiguration(
+ network_configuration_handler_->CreateShillConfiguration(
shill_properties, NetworkConfigurationObserver::SOURCE_POLICY,
base::Bind(
&ManagedNetworkConfigurationHandlerImpl::OnPolicyAppliedToNetwork,
@@ -540,7 +531,7 @@ void ManagedNetworkConfigurationHandlerImpl::
shill_properties.MergeDictionary(&new_properties);
- network_configuration_handler_->CreateConfiguration(
+ network_configuration_handler_->CreateShillConfiguration(
shill_properties, NetworkConfigurationObserver::SOURCE_POLICY,
base::Bind(
&ManagedNetworkConfigurationHandlerImpl::OnPolicyAppliedToNetwork,