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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 CheckEnabled(); | 219 CheckEnabled(); |
220 } | 220 } |
221 | 221 |
222 void ErrorConsole::OnExtensionLoaded(content::BrowserContext* browser_context, | 222 void ErrorConsole::OnExtensionLoaded(content::BrowserContext* browser_context, |
223 const Extension* extension) { | 223 const Extension* extension) { |
224 CheckEnabled(); | 224 CheckEnabled(); |
225 } | 225 } |
226 | 226 |
227 void ErrorConsole::OnExtensionInstalled( | 227 void ErrorConsole::OnExtensionInstalled( |
228 content::BrowserContext* browser_context, | 228 content::BrowserContext* browser_context, |
229 const Extension* extension) { | 229 const Extension* extension, |
| 230 bool is_update) { |
230 // We don't want to have manifest errors from previous installs. We want | 231 // We don't want to have manifest errors from previous installs. We want |
231 // to keep runtime errors, though, because extensions are reloaded on a | 232 // to keep runtime errors, though, because extensions are reloaded on a |
232 // 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 |
233 // whenever that happens. | 234 // whenever that happens. |
234 errors_.RemoveErrorsForExtensionOfType(extension->id(), | 235 errors_.RemoveErrorsForExtensionOfType(extension->id(), |
235 ExtensionError::MANIFEST_ERROR); | 236 ExtensionError::MANIFEST_ERROR); |
236 AddManifestErrorsForExtension(extension); | 237 AddManifestErrorsForExtension(extension); |
237 } | 238 } |
238 | 239 |
239 void ErrorConsole::OnExtensionUninstalled( | 240 void ErrorConsole::OnExtensionUninstalled( |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 ExtensionRegistry::Get(profile_)->GetExtensionById( | 278 ExtensionRegistry::Get(profile_)->GetExtensionById( |
278 extension_id, ExtensionRegistry::EVERYTHING); | 279 extension_id, ExtensionRegistry::EVERYTHING); |
279 if (extension && extension->location() == Manifest::UNPACKED) | 280 if (extension && extension->location() == Manifest::UNPACKED) |
280 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; | 281 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; |
281 | 282 |
282 // Otherwise, use the default mask. | 283 // Otherwise, use the default mask. |
283 return default_mask_; | 284 return default_mask_; |
284 } | 285 } |
285 | 286 |
286 } // namespace extensions | 287 } // namespace extensions |
OLD | NEW |