diff options
author | kaliamoorthi <kaliamoorthi@chromium.org> | 2015-03-18 06:36:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-18 13:37:33 +0000 |
commit | 9456b704d510e80096d7fdd804625840e3181020 (patch) | |
tree | 6fcb94cc1c4893eed848ee21754928096a2beb1f /extensions/browser/api/vpn_provider | |
parent | e155114412c87b15d6b250bc0d4826f9336792c9 (diff) | |
download | chromium_src-9456b704d510e80096d7fdd804625840e3181020.zip chromium_src-9456b704d510e80096d7fdd804625840e3181020.tar.gz chromium_src-9456b704d510e80096d7fdd804625840e3181020.tar.bz2 |
Add signal to vpnProvider for platform error
This CL adds an API that can be used to signal the VPN clients of
an error in the platform.
BUG=460428
Review URL: https://codereview.chromium.org/1012503003
Cr-Commit-Position: refs/heads/master@{#321117}
Diffstat (limited to 'extensions/browser/api/vpn_provider')
-rw-r--r-- | extensions/browser/api/vpn_provider/vpn_service.cc | 9 | ||||
-rw-r--r-- | extensions/browser/api/vpn_provider/vpn_service.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/extensions/browser/api/vpn_provider/vpn_service.cc b/extensions/browser/api/vpn_provider/vpn_service.cc index f60cf6a..f849f1f 100644 --- a/extensions/browser/api/vpn_provider/vpn_service.cc +++ b/extensions/browser/api/vpn_provider/vpn_service.cc @@ -173,6 +173,15 @@ void VpnService::SendShowConfigureDialogToExtension( configuration_id)); } +void VpnService::SendPlatformError(const std::string& extension_id, + const std::string& configuration_id, + const std::string& error_message) { + SendSignalToExtension( + extension_id, api_vpn::OnPlatformMessage::kEventName, + api_vpn::OnPlatformMessage::Create( + configuration_id, api_vpn::PLATFORM_MESSAGE_ERROR, error_message)); +} + std::string VpnService::GetKey(const std::string& extension_id, const std::string& name) { const std::string key = crypto::SHA256HashString(extension_id + name); diff --git a/extensions/browser/api/vpn_provider/vpn_service.h b/extensions/browser/api/vpn_provider/vpn_service.h index 92b8b01..96bca6e 100644 --- a/extensions/browser/api/vpn_provider/vpn_service.h +++ b/extensions/browser/api/vpn_provider/vpn_service.h @@ -72,6 +72,10 @@ class VpnService : public KeyedService, void SendShowConfigureDialogToExtension(const std::string& extension_id, const std::string& configuration_id); + void SendPlatformError(const std::string& extension_id, + const std::string& configuration_id, + const std::string& error_message); + // NetworkConfigurationObserver: void OnConfigurationCreated(const std::string& service_path, const std::string& profile_path, |