diff options
author | cernekee <cernekee@chromium.org> | 2016-03-15 16:33:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-15 23:35:10 +0000 |
commit | f1da84b10359d62c67a73e46da90b0d0510a0768 (patch) | |
tree | 26e92834631e010954b80a4cada4a6b6efd4f8bd /extensions/browser/api | |
parent | a3a50c140c60eb242df3dd4df06fe55cad117c75 (diff) | |
download | chromium_src-f1da84b10359d62c67a73e46da90b0d0510a0768.zip chromium_src-f1da84b10359d62c67a73e46da90b0d0510a0768.tar.gz chromium_src-f1da84b10359d62c67a73e46da90b0d0510a0768.tar.bz2 |
Invoke createNetwork() callback with GUID, not service name
The current implementation doesn't match the API spec. Fix this.
BUG=593196
TEST=go to chrome://settings/network , ctrl-shift-i, run in console:
chrome.networkingPrivate.createNetwork(false,
{"Type":"WiFi","WiFi":{"SSID":"GoogleGuest","AutoConnect":true}},
function(x) { console.log(x); })
Review URL: https://codereview.chromium.org/1779633002
Cr-Commit-Position: refs/heads/master@{#381347}
Diffstat (limited to 'extensions/browser/api')
3 files changed, 13 insertions, 3 deletions
diff --git a/extensions/browser/api/networking_private/networking_private_chromeos.cc b/extensions/browser/api/networking_private/networking_private_chromeos.cc index 5754f37..a710848 100644 --- a/extensions/browser/api/networking_private/networking_private_chromeos.cc +++ b/extensions/browser/api/networking_private/networking_private_chromeos.cc @@ -302,6 +302,13 @@ void NetworkingPrivateChromeOS::SetProperties( base::Bind(&NetworkHandlerFailureCallback, failure_callback)); } +void NetworkHandlerCreateCallback( + const NetworkingPrivateDelegate::StringCallback& callback, + const std::string& service_path, + const std::string& guid) { + callback.Run(guid); +} + void NetworkingPrivateChromeOS::CreateNetwork( bool shared, scoped_ptr<base::DictionaryValue> properties, @@ -316,7 +323,8 @@ void NetworkingPrivateChromeOS::CreateNetwork( } GetManagedConfigurationHandler()->CreateConfiguration( - user_id_hash, *properties, success_callback, + user_id_hash, *properties, + base::Bind(&NetworkHandlerCreateCallback, success_callback), base::Bind(&NetworkHandlerFailureCallback, failure_callback)); } diff --git a/extensions/browser/api/vpn_provider/vpn_service.cc b/extensions/browser/api/vpn_provider/vpn_service.cc index 1214a3b..7293f70 100644 --- a/extensions/browser/api/vpn_provider/vpn_service.cc +++ b/extensions/browser/api/vpn_provider/vpn_service.cc @@ -494,7 +494,8 @@ void VpnService::OnExtensionUnloaded( void VpnService::OnCreateConfigurationSuccess( const VpnService::SuccessCallback& callback, VpnConfiguration* configuration, - const std::string& service_path) { + const std::string& service_path, + const std::string& guid) { configuration->set_service_path(service_path); service_path_to_configuration_map_[service_path] = configuration; shill_client_->AddShillThirdPartyVpnObserver(configuration->object_path(), diff --git a/extensions/browser/api/vpn_provider/vpn_service.h b/extensions/browser/api/vpn_provider/vpn_service.h index 7aa1dc2..6e515c9 100644 --- a/extensions/browser/api/vpn_provider/vpn_service.h +++ b/extensions/browser/api/vpn_provider/vpn_service.h @@ -170,7 +170,8 @@ class VpnService : public KeyedService, // Callback used to indicate that configuration was successfully created. void OnCreateConfigurationSuccess(const SuccessCallback& callback, VpnConfiguration* configuration, - const std::string& service_path); + const std::string& service_path, + const std::string& guid); // Callback used to indicate that configuration creation failed. void OnCreateConfigurationFailure( |