| Index: chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc
|
| diff --git a/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc b/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc
|
| index 9b4ad43543ca09d5004592423341b8df9c805785..a84f5fd9ad10f0186552667ef6bf2aef2f4e24c6 100644
|
| --- a/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc
|
| +++ b/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc
|
| @@ -210,6 +210,35 @@ void NetworkingPrivateCreateNetworkFunction::ResultCallback(
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// NetworkingPrivateGetNetworksFunction
|
| +
|
| +NetworkingPrivateGetNetworksFunction::
|
| + ~NetworkingPrivateGetNetworksFunction() {
|
| +}
|
| +
|
| +bool NetworkingPrivateGetNetworksFunction::RunAsync() {
|
| + scoped_ptr<api::GetNetworks::Params> params =
|
| + api::GetNetworks::Params::Create(*args_);
|
| + EXTENSION_FUNCTION_VALIDATE(params);
|
| +
|
| + // TODO(stevenjb/mef): Apply filters (visible, configured).
|
| + NetworkingPrivateServiceClient* service_client =
|
| + NetworkingPrivateServiceClientFactory::GetForProfile(GetProfile());
|
| +
|
| + service_client->GetVisibleNetworks(
|
| + api::ToString(params->filter.network_type),
|
| + base::Bind(&NetworkingPrivateGetNetworksFunction::ResultCallback, this));
|
| +
|
| + return true;
|
| +}
|
| +
|
| +void NetworkingPrivateGetNetworksFunction::ResultCallback(
|
| + const base::ListValue& network_list) {
|
| + SetResult(network_list.DeepCopy());
|
| + SendResponse(true);
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // NetworkingPrivateGetVisibleNetworksFunction
|
|
|
| NetworkingPrivateGetVisibleNetworksFunction::
|
| @@ -225,7 +254,7 @@ bool NetworkingPrivateGetVisibleNetworksFunction::RunAsync() {
|
| NetworkingPrivateServiceClientFactory::GetForProfile(GetProfile());
|
|
|
| service_client->GetVisibleNetworks(
|
| - api::GetVisibleNetworks::Params::ToString(params->type),
|
| + api::ToString(params->network_type),
|
| base::Bind(&NetworkingPrivateGetVisibleNetworksFunction::ResultCallback,
|
| this));
|
|
|
|
|