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

Unified Diff: components/search_engines/template_url_service.cc

Issue 2799083003: Replace manual GoogleURLTracker update request with call to utility function. (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/browser/profile_resetter/profile_resetter.cc ('k') | 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 b85e4f075618964e3d31d2c6ea912cbb68ba09eb..0a736ac2b08354c529dc098d04708f9734fd86df 100644
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -671,18 +671,7 @@ void TemplateURLService::RepairPrepopulatedSearchEngines() {
default_search_manager_.ClearUserSelectedDefaultSearchEngine();
- if (!default_search_provider_) {
- // If the default search provider came from a user pref we would have been
- // notified of the new (fallback-provided) value in
- // ClearUserSelectedDefaultSearchEngine() above. Since we are here, the
- // value was presumably originally a fallback value (which may have been
- // repaired).
- DefaultSearchManager::Source source;
- const TemplateURLData* new_dse =
- default_search_manager_.GetDefaultSearchEngine(&source);
- // ApplyDefaultSearchChange will notify observers once it is done.
- ApplyDefaultSearchChange(new_dse, source);
- } else {
+ if (default_search_provider_) {
// Set fallback engine as user selected, because repair is considered a user
// action and we are expected to sync new fallback engine to other devices.
const TemplateURLData* fallback_engine_data =
@@ -701,6 +690,18 @@ void TemplateURLService::RepairPrepopulatedSearchEngines() {
fallback_engine->sync_guid());
}
NotifyObservers();
+ RequestGoogleURLTrackerServerCheckIfNecessary();
vasilii 2017/04/06 09:33:17 There is a behavior change here. ProfileResetter c
Peter Kasting 2017/04/06 09:43:26 I missed that. Why did the old code set force=tru
+ } else {
+ // If the default search provider came from a user pref we would have been
+ // notified of the new (fallback-provided) value in
+ // ClearUserSelectedDefaultSearchEngine() above. Since we are here, the
+ // value was presumably originally a fallback value (which may have been
+ // repaired).
+ DefaultSearchManager::Source source;
+ const TemplateURLData* new_dse =
+ default_search_manager_.GetDefaultSearchEngine(&source);
+ // ApplyDefaultSearchChange will notify observers once it is done.
+ ApplyDefaultSearchChange(new_dse, source);
}
}
« no previous file with comments | « chrome/browser/profile_resetter/profile_resetter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698