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..00da2096fb64807f55e6f0ad8ae63104c4dcdb42 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,11 @@ 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()) |
+ extension_prefs_->extension_sorting()->EnsureValidOrdinals(extension->id()); |
+ |
extensions_.Insert(scoped_extension); |
SyncExtensionChangeIfNeeded(*extension); |
NotifyExtensionLoaded(extension); |