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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 17038002: Separate the NTP app ordering from the app list app ordering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add sync test Created 7 years, 6 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
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index e706a05f608e555b686c3103e785464cfdca6e7f..aef359fefbee4ec2e40677f26466eb0c56d8186d 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -417,6 +417,7 @@ ExtensionService::ExtensionService(Profile* profile,
// Set this as the ExtensionService for extension sorting to ensure it
// cause syncs if required.
extension_prefs_->extension_sorting()->SetExtensionService(this);
+ extension_prefs_->app_list_extension_ordering()->SetExtensionService(this);
is_first_run_ = !extension_prefs_->SetAlertSystemFirstRun();
@@ -1377,6 +1378,7 @@ syncer::SyncError ExtensionService::ProcessSyncChanges(
}
extension_prefs()->extension_sorting()->FixNTPOrdinalCollisions();
+ extension_prefs()->app_list_extension_ordering()->FixSyncCollisions();
return syncer::SyncError();
}
@@ -1396,7 +1398,9 @@ extensions::AppSyncData ExtensionService::GetAppSyncData(
IsIncognitoEnabled(extension.id()),
extension_prefs_->extension_sorting()->GetAppLaunchOrdinal(
extension.id()),
- extension_prefs_->extension_sorting()->GetPageOrdinal(extension.id()));
+ extension_prefs_->extension_sorting()->GetPageOrdinal(extension.id()),
+ extension_prefs_->app_list_extension_ordering()->
+ GetAppListOrdinal(extension.id()));
}
std::vector<extensions::ExtensionSyncData>
@@ -1462,6 +1466,15 @@ bool ExtensionService::ProcessAppSyncData(
id,
app_sync_data.page_ordinal());
}
+ if (app_sync_data.app_list_ordinal().IsValid()) {
+ AppListExtensionOrdering* ordering =
+ extension_prefs_->app_list_extension_ordering();
+ if (ordering->Contains(id))
+ ordering->Erase(id);
+ ordering->SetAppListOrdinalForSync(
koz (OOO until 15th September) 2013/06/18 07:41:36 Why do we need to Erase() here? Can we not clobber
calamity 2013/06/19 05:09:17 Done.
+ id,
+ app_sync_data.app_list_ordinal());
+ }
if (!ProcessExtensionSyncDataHelper(app_sync_data.extension_sync_data(),
syncer::APPS)) {
@@ -2108,6 +2121,10 @@ void ExtensionService::AddExtension(const Extension* extension) {
}
extension_prefs_->extension_sorting()->EnsureValidOrdinals(
extension->id(), syncer::StringOrdinal());
+ AppListExtensionOrdering* ordering =
+ extension_prefs_->app_list_extension_ordering();
+ if (!ordering->Contains(extension->id()))
+ ordering->InsertAtNextAvailable(extension->id());
}
extensions_.Insert(extension);

Powered by Google App Engine
This is Rietveld 408576698