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

Unified Diff: components/search_engines/template_url_service.cc

Issue 2354413004: Delete from Sync the artificial search engines created by the omnibox extensions. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url_service.cc
diff --git a/components/search_engines/template_url_service.cc b/components/search_engines/template_url_service.cc
index 18f5d5585c522b8d9e45da6c5214531c89da3dc4..06b055ae9ef32bfb5929c4bf70e3681e4934a2fc 100644
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -1344,15 +1344,18 @@ TemplateURLService::CreateTemplateURLFromTemplateURLAndSyncData(
UpdateTemplateURLIfPrepopulated(turl.get(), prefs);
// We used to sync keywords associated with omnibox extensions, but no longer
- // want to. However, if we delete these keywords from sync, we'll break any
- // synced old versions of Chrome which were relying on them. Instead, for now
- // we simply ignore these.
- // TODO(vasilii): After a few Chrome versions, change this to go ahead and
- // delete these from sync.
+ // want to. Delete them from the server.
+ // TODO(vasilii): After a few Chrome versions, delete this code together with
+ // RestoreExtensionInfoIfNecessary().
Peter Kasting 2016/09/22 19:01:44 Just to make sure I understand: is RestoreExtensio
vasilii 2016/09/28 10:00:11 Until few days ago there was no |type_| in the Tem
Peter Kasting 2016/09/28 19:34:34 What I'm thinking is, we don't actually need Resto
vasilii 2016/09/29 11:48:06 We could but it's a layering violation. The compon
DCHECK(client);
client->RestoreExtensionInfoIfNecessary(turl.get());
- if (turl->GetType() == TemplateURL::OMNIBOX_API_EXTENSION)
+ if (turl->GetType() == TemplateURL::OMNIBOX_API_EXTENSION) {
+ change_list->push_back(
+ syncer::SyncChange(FROM_HERE,
+ syncer::SyncChange::ACTION_DELETE,
+ sync_data));
return nullptr;
+ }
DCHECK_EQ(TemplateURL::NORMAL, turl->GetType());
if (reset_keyword || deduped) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698