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

Unified Diff: chrome/browser/search_engines/template_url_service.cc

Issue 10831338: Ensure that MergeDataAndStartSyncing considers already synced entries when setting the synced DSP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: check once instead of per processed turl Created 8 years, 4 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/search_engines/template_url_service.cc
===================================================================
--- chrome/browser/search_engines/template_url_service.cc (revision 151691)
+++ chrome/browser/search_engines/template_url_service.cc (working copy)
@@ -1165,6 +1165,15 @@
}
}
+ // If there is a pending synced default search provider that was processed
+ // above, set it now.
+ TemplateURL* pending_default = GetPendingSyncedDefaultSearchProvider();
+ if (pending_default) {
+ AutoReset<DefaultSearchChangeOrigin> change_origin(
+ &dsp_change_origin_, DSP_CHANGE_SYNC_ADD);
+ SetDefaultSearchProvider(pending_default);
+ }
+
// The remaining SyncData in local_data_map should be everything that needs to
// be pushed as ADDs to sync.
for (SyncDataMap::const_iterator iter = local_data_map.begin();
@@ -2425,9 +2434,6 @@
TemplateURLData data(sync_turl->data());
data.id = kInvalidTemplateURLID;
Add(new TemplateURL(profile_, data));
-
- // Possibly set the newly added |turl| as the default search provider.
- SetDefaultSearchProviderIfNewlySynced(guid);
}
}

Powered by Google App Engine
This is Rietveld 408576698