Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.cc |
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
| index 84397982cc4e10874b4d7d1a24dfd29d71d0adef..6d64e7e94b5b45b652ae48e23b7ee7802dca06e3 100644 |
| --- a/chrome/browser/extensions/extension_service.cc |
| +++ b/chrome/browser/extensions/extension_service.cc |
| @@ -1573,8 +1573,13 @@ void ExtensionService::SetIsIncognitoEnabled( |
| const std::string& extension_id, bool enabled) { |
| const Extension* extension = GetInstalledExtension(extension_id); |
| if (extension && extension->location() == Extension::COMPONENT) { |
| - // This shouldn't be called for component extensions. |
| - NOTREACHED(); |
| + // This shouldn't be called for component extensions unless they are |
| + // syncable. |
| + DCHECK(extension->IsSyncable()); |
| + |
| + // If we are here, make sure the we aren't trying to change the value. |
| + DCHECK_EQ(enabled, IsIncognitoEnabled(extension_id)); |
| + |
| return; |
| } |
| @@ -2050,6 +2055,12 @@ void ExtensionService::AddExtension(const Extension* extension) { |
| return; |
| } |
| + // All apps that are displayed in the launcher are ordered by their ordinals |
| + // so we must ensure they have valid ordinals. |
| + if (extension->ShouldDisplayInLauncher()) { |
|
Aaron Boodman
2012/02/09 19:17:37
Nit: Braces are not required for one-line ifs. In
csharp
2012/02/09 19:53:17
Done.
|
| + extension_prefs_->extension_sorting()->EnsureValidOrdinals(extension->id()); |
| + } |
| + |
| extensions_.Insert(scoped_extension); |
| SyncExtensionChangeIfNeeded(*extension); |
| NotifyExtensionLoaded(extension); |