Index: chrome/browser/extensions/extension_service.cc |
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
index 6a0b4b6e4410f62ba0964d252c1a163df7999f7b..4a9fecd17c439e4f78c67fd6b20f282f80620bfd 100644 |
--- a/chrome/browser/extensions/extension_service.cc |
+++ b/chrome/browser/extensions/extension_service.cc |
@@ -1433,11 +1433,14 @@ void ExtensionService::AddExtension(const Extension* extension) { |
// All apps that are displayed in the launcher are ordered by their ordinals |
// so we must ensure they have valid ordinals. |
if (extension->RequiresSortOrdinal()) { |
- if (!extension->ShouldDisplayInNewTabPage()) { |
- extension_prefs_->app_sorting()->MarkExtensionAsHidden(extension->id()); |
+ extension_prefs_->app_sorting()->SetExtensionVisible( |
+ extension->id(), |
+ extension->ShouldDisplayInNewTabPage() && |
+ !extension_prefs_->IsEphemeralApp(extension->id())); |
tapted
2014/07/17 04:29:46
are ephemeral apps never displayed in the new tab
tmdiep
2014/07/17 05:48:57
I wish it could be just fully encapsulated in the
tapted
2014/07/17 05:59:53
Ah - drat.
|
+ if (!extension_prefs_->IsEphemeralApp(extension->id())) { |
+ extension_prefs_->app_sorting()->EnsureValidOrdinals( |
+ extension->id(), syncer::StringOrdinal()); |
} |
- extension_prefs_->app_sorting()->EnsureValidOrdinals( |
- extension->id(), syncer::StringOrdinal()); |
} |
registry_->AddEnabled(extension); |
@@ -1845,8 +1848,11 @@ void ExtensionService::PromoteEphemeralApp( |
DCHECK(GetInstalledExtension(extension->id()) && |
extension_prefs_->IsEphemeralApp(extension->id())); |
- if (!is_from_sync) { |
- if (extension->RequiresSortOrdinal()) { |
+ if (extension->RequiresSortOrdinal()) { |
+ extension_prefs_->app_sorting()->SetExtensionVisible( |
+ extension->id(), extension->ShouldDisplayInNewTabPage()); |
+ |
+ if (!is_from_sync) { |
tapted
2014/07/17 04:29:46
After tracing down ordinal CHECK()s in the past I'
tmdiep
2014/07/17 05:48:57
I've refactored to always call EnsureValidOrdinals
|
// Reset the sort ordinals of the app to ensure it is added to the default |
// position, like newly installed apps would. |
extension_prefs_->app_sorting()->ClearOrdinals(extension->id()); |