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

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: comments Created 4 years, 2 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 | « components/search_engines/template_url.h ('k') | components/search_engines/template_url_service_client.h » ('j') | 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 a079513ef4b8427dd5725ed2e385048163832a6c..29a06edce379fba99cde94c2a2966d280930b637 100644
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -1351,15 +1351,17 @@ 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
+ // IsOmniboxExtensionURL().
DCHECK(client);
- client->RestoreExtensionInfoIfNecessary(turl.get());
- if (turl->type() == TemplateURL::OMNIBOX_API_EXTENSION)
+ if (client->IsOmniboxExtensionURL(turl->url())) {
+ change_list->push_back(
+ syncer::SyncChange(FROM_HERE,
+ syncer::SyncChange::ACTION_DELETE,
+ sync_data));
return nullptr;
+ }
DCHECK_EQ(TemplateURL::NORMAL, turl->type());
if (reset_keyword || deduped) {
« no previous file with comments | « components/search_engines/template_url.h ('k') | components/search_engines/template_url_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698