Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: extensions/browser/api/vpn_provider/vpn_service.cc

Issue 999783002: Extend vpnProvider API to support future enhancements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added documentation for UI events Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api/vpn_provider/vpn_service.h ('k') | extensions/common/api/vpn_provider.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/vpn_provider/vpn_service.cc
diff --git a/extensions/browser/api/vpn_provider/vpn_service.cc b/extensions/browser/api/vpn_provider/vpn_service.cc
index 8d8296d850371be8e76f6a8f72f43da0fe6debbe..8157b9429deafc937ec2c60a6fcac6bde10c4b60 100644
--- a/extensions/browser/api/vpn_provider/vpn_service.cc
+++ b/extensions/browser/api/vpn_provider/vpn_service.cc
@@ -159,6 +159,21 @@ VpnService::~VpnService() {
key_to_configuration_map_.end());
}
+void VpnService::SendShowAddDialogToExtension(const std::string& extension_id) {
+ SendSignalToExtension(extension_id, api_vpn::OnUIEvent::kEventName,
+ api_vpn::OnUIEvent::Create(
+ api_vpn::UI_EVENT_SHOWADDDIALOG, std::string()));
+}
+
+void VpnService::SendShowConfigureDialogToExtension(
+ const std::string& extension_id,
+ const std::string& configuration_id) {
+ SendSignalToExtension(
+ extension_id, api_vpn::OnUIEvent::kEventName,
+ api_vpn::OnUIEvent::Create(api_vpn::UI_EVENT_SHOWCONFIGUREDIALOG,
+ configuration_id));
+}
+
void VpnService::OnConfigurationCreated(const std::string& service_path,
const std::string& profile_path,
const base::DictionaryValue& properties,
@@ -316,10 +331,11 @@ void VpnService::CreateConfiguration(const std::string& extension_id,
}
void VpnService::DestroyConfiguration(const std::string& extension_id,
- const std::string& configuration_name,
+ const std::string& configuration_id,
const SuccessCallback& success,
const FailureCallback& failure) {
- const std::string key = GetKey(extension_id, configuration_name);
+ // The ID is the configuration name for now. This may change in the future.
+ const std::string key = GetKey(extension_id, configuration_id);
if (!ContainsKey(key_to_configuration_map_, key)) {
failure.Run(std::string(), std::string("Unauthorized access."));
return;
« no previous file with comments | « extensions/browser/api/vpn_provider/vpn_service.h ('k') | extensions/common/api/vpn_provider.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698