OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/error_console/error_console.h" | 5 #include "chrome/browser/extensions/error_console/error_console.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // to keep runtime errors, though, because extensions are reloaded on a | 232 // to keep runtime errors, though, because extensions are reloaded on a |
233 // refresh of chrome:extensions, and we don't want to wipe our history | 233 // refresh of chrome:extensions, and we don't want to wipe our history |
234 // whenever that happens. | 234 // whenever that happens. |
235 errors_.RemoveErrorsForExtensionOfType(extension->id(), | 235 errors_.RemoveErrorsForExtensionOfType(extension->id(), |
236 ExtensionError::MANIFEST_ERROR); | 236 ExtensionError::MANIFEST_ERROR); |
237 AddManifestErrorsForExtension(extension); | 237 AddManifestErrorsForExtension(extension); |
238 } | 238 } |
239 | 239 |
240 void ErrorConsole::OnExtensionUninstalled( | 240 void ErrorConsole::OnExtensionUninstalled( |
241 content::BrowserContext* browser_context, | 241 content::BrowserContext* browser_context, |
242 const Extension* extension) { | 242 const Extension* extension, |
| 243 extensions::UninstallReason reason) { |
243 errors_.Remove(extension->id()); | 244 errors_.Remove(extension->id()); |
244 } | 245 } |
245 | 246 |
246 void ErrorConsole::AddManifestErrorsForExtension(const Extension* extension) { | 247 void ErrorConsole::AddManifestErrorsForExtension(const Extension* extension) { |
247 const std::vector<InstallWarning>& warnings = | 248 const std::vector<InstallWarning>& warnings = |
248 extension->install_warnings(); | 249 extension->install_warnings(); |
249 for (std::vector<InstallWarning>::const_iterator iter = warnings.begin(); | 250 for (std::vector<InstallWarning>::const_iterator iter = warnings.begin(); |
250 iter != warnings.end(); ++iter) { | 251 iter != warnings.end(); ++iter) { |
251 ReportError(scoped_ptr<ExtensionError>(new ManifestError( | 252 ReportError(scoped_ptr<ExtensionError>(new ManifestError( |
252 extension->id(), | 253 extension->id(), |
(...skipping 25 matching lines...) Expand all Loading... |
278 ExtensionRegistry::Get(profile_)->GetExtensionById( | 279 ExtensionRegistry::Get(profile_)->GetExtensionById( |
279 extension_id, ExtensionRegistry::EVERYTHING); | 280 extension_id, ExtensionRegistry::EVERYTHING); |
280 if (extension && extension->location() == Manifest::UNPACKED) | 281 if (extension && extension->location() == Manifest::UNPACKED) |
281 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; | 282 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; |
282 | 283 |
283 // Otherwise, use the default mask. | 284 // Otherwise, use the default mask. |
284 return default_mask_; | 285 return default_mask_; |
285 } | 286 } |
286 | 287 |
287 } // namespace extensions | 288 } // namespace extensions |
OLD | NEW |