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

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

Issue 974443002: Make vpn destroyConfig generate disconnect message for connected configuration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments from Bartosz 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') | no next file » | 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 7a51aac70dad68758c332cc4fb1fc6e35abfd96e..799ef19ba2245efe379214ff9dfbc36fa8b3581d 100644
--- a/extensions/browser/api/vpn_provider/vpn_service.cc
+++ b/extensions/browser/api/vpn_provider/vpn_service.cc
@@ -342,6 +342,9 @@ void VpnService::DestroyConfiguration(const std::string& extension_id,
VpnConfiguration* configuration = key_to_configuration_map_[key];
const std::string service_path = configuration->service_path();
+ if (active_configuration_ == configuration) {
+ configuration->OnPlatformMessage(api_vpn::PLATFORM_MESSAGE_DISCONNECTED);
+ }
DestroyConfigurationInternal(configuration);
network_configuration_handler_->RemoveConfiguration(
@@ -421,6 +424,24 @@ void VpnService::OnExtensionUninstalled(
}
}
+void VpnService::OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionInfo::Reason reason) {
+ if (browser_context != browser_context_) {
+ NOTREACHED();
+ return;
+ }
+
+ if (active_configuration_ &&
+ active_configuration_->extension_id() == extension->id()) {
+ shill_client_->UpdateConnectionState(
+ active_configuration_->object_path(),
+ static_cast<uint32_t>(api_vpn::VPN_CONNECTION_STATE_FAILURE),
+ base::Bind(base::DoNothing), base::Bind(DoNothingFailureCallback));
+ }
+}
+
void VpnService::OnCreateConfigurationSuccess(
const VpnService::SuccessCallback& callback,
VpnConfiguration* configuration,
« no previous file with comments | « extensions/browser/api/vpn_provider/vpn_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698