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

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

Issue 8889048: Add preexisting local extensions to sync bundle when sync is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years 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
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index c5fd28c1029451bfae8dbc9c7633ac29263acf4a..12327db45ab92f35ed02f7cef8770976d9af4db7 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1305,6 +1305,7 @@ SyncError ExtensionService::MergeDataAndStartSyncing(
bundle->sync_processor = sync_processor;
+ // Process extensions from sync.
for (SyncDataList::const_iterator i = initial_sync_data.begin();
i != initial_sync_data.end();
++i) {
@@ -1313,15 +1314,20 @@ SyncError ExtensionService::MergeDataAndStartSyncing(
ProcessExtensionSyncData(extension_sync_data, *bundle);
}
+ // Process local extensions.
+ // TODO(yoz): Determine whether pending extensions should be considered too.
+ // See crbug.com/104399.
SyncDataList sync_data_list = GetAllSyncData(type);
SyncChangeList sync_change_list;
for (SyncDataList::const_iterator i = sync_data_list.begin();
i != sync_data_list.end();
++i) {
- if (bundle->HasExtensionId(i->GetTag()))
+ if (bundle->HasExtensionId(i->GetTag())) {
sync_change_list.push_back(SyncChange(SyncChange::ACTION_UPDATE, *i));
- else
+ } else {
+ bundle->synced_extensions.insert(i->GetTag());
sync_change_list.push_back(SyncChange(SyncChange::ACTION_ADD, *i));
+ }
}
bundle->sync_processor->ProcessSyncChanges(FROM_HERE, sync_change_list);
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698