From 9456b704d510e80096d7fdd804625840e3181020 Mon Sep 17 00:00:00 2001 From: kaliamoorthi Date: Wed, 18 Mar 2015 06:36:30 -0700 Subject: 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} --- extensions/browser/api/vpn_provider/vpn_service.cc | 9 +++++++++ extensions/browser/api/vpn_provider/vpn_service.h | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'extensions/browser/api/vpn_provider') 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, -- cgit v1.1