| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 AcknowledgeExternalExtension(extension->id()); | 168 AcknowledgeExternalExtension(extension->id()); |
| 169 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_REENABLED); | 169 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_REENABLED); |
| 170 | 170 |
| 171 // If we had an error for this extension, remove it. | 171 // If we had an error for this extension, remove it. |
| 172 if (error_.get() && extension->id() == error_->extension_id()) | 172 if (error_.get() && extension->id() == error_->extension_id()) |
| 173 RemoveExternalInstallError(); | 173 RemoveExternalInstallError(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void ExternalInstallManager::OnExtensionInstalled( | 176 void ExternalInstallManager::OnExtensionInstalled( |
| 177 content::BrowserContext* browser_context, | 177 content::BrowserContext* browser_context, |
| 178 const Extension* extension) { | 178 const Extension* extension, |
| 179 bool is_update) { |
| 179 // Certain extension locations are specific enough that we can | 180 // Certain extension locations are specific enough that we can |
| 180 // auto-acknowledge any extension that came from one of them. | 181 // auto-acknowledge any extension that came from one of them. |
| 181 if (Manifest::IsPolicyLocation(extension->location()) || | 182 if (Manifest::IsPolicyLocation(extension->location()) || |
| 182 extension->location() == Manifest::EXTERNAL_COMPONENT) { | 183 extension->location() == Manifest::EXTERNAL_COMPONENT) { |
| 183 AcknowledgeExternalExtension(extension->id()); | 184 AcknowledgeExternalExtension(extension->id()); |
| 184 return; | 185 return; |
| 185 } | 186 } |
| 186 | 187 |
| 187 if (!IsUnacknowledgedExternalExtension(extension)) | 188 if (!IsUnacknowledgedExternalExtension(extension)) |
| 188 return; | 189 return; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // registry observer) for this, but the ExtensionUnloaded notification is | 221 // registry observer) for this, but the ExtensionUnloaded notification is |
| 221 // not sent out if the extension is disabled (which it is here). | 222 // not sent out if the extension is disabled (which it is here). |
| 222 if (error_.get() && | 223 if (error_.get() && |
| 223 content::Details<const Extension>(details).ptr()->id() == | 224 content::Details<const Extension>(details).ptr()->id() == |
| 224 error_->extension_id()) { | 225 error_->extension_id()) { |
| 225 RemoveExternalInstallError(); | 226 RemoveExternalInstallError(); |
| 226 } | 227 } |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace extensions | 230 } // namespace extensions |
| OLD | NEW |