| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/external_install_manager.h" | 5 #include "chrome/browser/extensions/external_install_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 if (!IsUnacknowledgedExternalExtension(extension)) | 188 if (!IsUnacknowledgedExternalExtension(extension)) |
| 189 return; | 189 return; |
| 190 | 190 |
| 191 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_INSTALLED); | 191 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_INSTALLED); |
| 192 | 192 |
| 193 UpdateExternalExtensionAlert(); | 193 UpdateExternalExtensionAlert(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void ExternalInstallManager::OnExtensionUninstalled( | 196 void ExternalInstallManager::OnExtensionUninstalled( |
| 197 content::BrowserContext* browser_context, | 197 content::BrowserContext* browser_context, |
| 198 const Extension* extension) { | 198 const Extension* extension, |
| 199 extensions::UninstallReason reason) { |
| 199 if (IsUnacknowledgedExternalExtension(extension)) | 200 if (IsUnacknowledgedExternalExtension(extension)) |
| 200 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_UNINSTALLED); | 201 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_UNINSTALLED); |
| 201 } | 202 } |
| 202 | 203 |
| 203 bool ExternalInstallManager::IsUnacknowledgedExternalExtension( | 204 bool ExternalInstallManager::IsUnacknowledgedExternalExtension( |
| 204 const Extension* extension) const { | 205 const Extension* extension) const { |
| 205 if (!FeatureSwitch::prompt_for_external_extensions()->IsEnabled()) | 206 if (!FeatureSwitch::prompt_for_external_extensions()->IsEnabled()) |
| 206 return false; | 207 return false; |
| 207 | 208 |
| 208 return (Manifest::IsExternalLocation(extension->location()) && | 209 return (Manifest::IsExternalLocation(extension->location()) && |
| (...skipping 12 matching lines...) Expand all Loading... |
| 221 // registry observer) for this, but the ExtensionUnloaded notification is | 222 // registry observer) for this, but the ExtensionUnloaded notification is |
| 222 // not sent out if the extension is disabled (which it is here). | 223 // not sent out if the extension is disabled (which it is here). |
| 223 if (error_.get() && | 224 if (error_.get() && |
| 224 content::Details<const Extension>(details).ptr()->id() == | 225 content::Details<const Extension>(details).ptr()->id() == |
| 225 error_->extension_id()) { | 226 error_->extension_id()) { |
| 226 RemoveExternalInstallError(); | 227 RemoveExternalInstallError(); |
| 227 } | 228 } |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace extensions | 231 } // namespace extensions |
| OLD | NEW |