Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: extensions/browser/extension_prefs.cc

Issue 397903002: Do not assign launch ordinals to ephemeral apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ephemapp_unload_review
Patch Set: Changed implementation Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« extensions/browser/app_sorting.h ('K') | « extensions/browser/app_sorting.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index 7799f0d04dde7d06fae7238dd78a9b00f5a59883..2b7c30bdbecbbac461bec2dfea400787f1e285b8 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -1237,9 +1237,14 @@ void ExtensionPrefs::OnExtensionInstalled(
install_flags,
install_parameter,
extension_dict);
- FinishExtensionInfoPrefs(extension->id(), install_time,
- extension->RequiresSortOrdinal(),
- page_ordinal, extension_dict);
+
+ bool requires_sort_ordinal = extension->RequiresSortOrdinal() &&
+ (install_flags & kInstallFlagIsEphemeral) == 0;
+ FinishExtensionInfoPrefs(extension->id(),
+ install_time,
+ requires_sort_ordinal,
+ page_ordinal,
+ extension_dict);
}
void ExtensionPrefs::OnExtensionUninstalled(const std::string& extension_id,
@@ -1452,7 +1457,8 @@ void ExtensionPrefs::SetDelayedInstallInfo(
// Add transient data that is needed by FinishDelayedInstallInfo(), but
// should not be in the final extension prefs. All entries here should have
// a corresponding Remove() call in FinishDelayedInstallInfo().
- if (extension->RequiresSortOrdinal()) {
+ if (extension->RequiresSortOrdinal() &&
+ (install_flags & kInstallFlagIsEphemeral) == 0) {
extension_dict->SetString(
kPrefSuggestedPageOrdinal,
page_ordinal.IsValid() ? page_ordinal.ToInternalValue()
« extensions/browser/app_sorting.h ('K') | « extensions/browser/app_sorting.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698