| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/ash/vpn_list_forwarder.h" | 5 #include "chrome/browser/ui/ash/vpn_list_forwarder.h" |
| 6 | 6 |
| 7 #include "ash/public/interfaces/constants.mojom.h" | 7 #include "ash/public/interfaces/constants.mojom.h" |
| 8 #include "ash/public/interfaces/vpn_list.mojom.h" | 8 #include "ash/public/interfaces/vpn_list.mojom.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void VpnListForwarder::OnExtensionLoaded( | 73 void VpnListForwarder::OnExtensionLoaded( |
| 74 content::BrowserContext* browser_context, | 74 content::BrowserContext* browser_context, |
| 75 const extensions::Extension* extension) { | 75 const extensions::Extension* extension) { |
| 76 if (IsVPNProvider(extension)) | 76 if (IsVPNProvider(extension)) |
| 77 UpdateVPNProviders(); | 77 UpdateVPNProviders(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void VpnListForwarder::OnExtensionUnloaded( | 80 void VpnListForwarder::OnExtensionUnloaded( |
| 81 content::BrowserContext* browser_context, | 81 content::BrowserContext* browser_context, |
| 82 const extensions::Extension* extension, | 82 const extensions::Extension* extension, |
| 83 extensions::UnloadedExtensionInfo::Reason reason) { | 83 extensions::UnloadedExtensionReason reason) { |
| 84 if (IsVPNProvider(extension)) | 84 if (IsVPNProvider(extension)) |
| 85 UpdateVPNProviders(); | 85 UpdateVPNProviders(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void VpnListForwarder::OnShutdown(extensions::ExtensionRegistry* registry) { | 88 void VpnListForwarder::OnShutdown(extensions::ExtensionRegistry* registry) { |
| 89 DCHECK(extension_registry_); | 89 DCHECK(extension_registry_); |
| 90 extension_registry_->RemoveObserver(this); | 90 extension_registry_->RemoveObserver(this); |
| 91 extension_registry_ = nullptr; | 91 extension_registry_ = nullptr; |
| 92 } | 92 } |
| 93 | 93 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 | 145 |
| 146 void VpnListForwarder::AttachToPrimaryUserExtensionRegistry() { | 146 void VpnListForwarder::AttachToPrimaryUserExtensionRegistry() { |
| 147 DCHECK(!extension_registry_); | 147 DCHECK(!extension_registry_); |
| 148 extension_registry_ = | 148 extension_registry_ = |
| 149 extensions::ExtensionRegistry::Get(GetProfileForPrimaryUser()); | 149 extensions::ExtensionRegistry::Get(GetProfileForPrimaryUser()); |
| 150 extension_registry_->AddObserver(this); | 150 extension_registry_->AddObserver(this); |
| 151 | 151 |
| 152 UpdateVPNProviders(); | 152 UpdateVPNProviders(); |
| 153 } | 153 } |
| OLD | NEW |