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

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

Issue 1722453002: Extend vpnProvider to allow reconnections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment Created 4 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_provider_api.cc ('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 7293f7072a5a67628cc728d6e2beffd6dcac39f8..09452d5290f194177562cb6feeeb7b4dba27ac5f 100644
--- a/extensions/browser/api/vpn_provider/vpn_service.cc
+++ b/extensions/browser/api/vpn_provider/vpn_service.cc
@@ -114,8 +114,13 @@ void VpnService::VpnConfiguration::OnPlatformMessage(uint32_t message) {
api_vpn::PlatformMessage platform_message =
static_cast<api_vpn::PlatformMessage>(message);
- vpn_service_->SetActiveConfiguration(
- platform_message == api_vpn::PLATFORM_MESSAGE_CONNECTED ? this : nullptr);
+
+ if (platform_message == api_vpn::PLATFORM_MESSAGE_CONNECTED) {
+ vpn_service_->SetActiveConfiguration(this);
+ } else if (platform_message == api_vpn::PLATFORM_MESSAGE_DISCONNECTED ||
+ platform_message == api_vpn::PLATFORM_MESSAGE_ERROR) {
+ vpn_service_->SetActiveConfiguration(nullptr);
+ }
// TODO(kaliamoorthi): Update the lower layers to get the error message and
// pass in the error instead of std::string().
« no previous file with comments | « extensions/browser/api/vpn_provider/vpn_provider_api.cc ('k') | extensions/common/api/vpn_provider.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698