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

Side by Side Diff: chrome/browser/profile_resetter/profile_resetter.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profile_resetter/profile_resetter.h" 5 #include "chrome/browser/profile_resetter/profile_resetter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 master_settings_->GetSearchProviderOverrides()); 175 master_settings_->GetSearchProviderOverrides());
176 if (search_engines) { 176 if (search_engines) {
177 // This Chrome distribution channel provides a custom search engine. We 177 // This Chrome distribution channel provides a custom search engine. We
178 // must reset to it. 178 // must reset to it.
179 ListPrefUpdate update(prefs, prefs::kSearchProviderOverrides); 179 ListPrefUpdate update(prefs, prefs::kSearchProviderOverrides);
180 update->Swap(search_engines.get()); 180 update->Swap(search_engines.get());
181 } 181 }
182 182
183 template_url_service_->RepairPrepopulatedSearchEngines(); 183 template_url_service_->RepairPrepopulatedSearchEngines();
184 184
185 // Reset Google search URL.
186 const TemplateURL* default_search_provider =
187 template_url_service_->GetDefaultSearchProvider();
188 if (default_search_provider &&
189 default_search_provider->HasGoogleBaseURLs(
190 template_url_service_->search_terms_data())) {
191 GoogleURLTracker* tracker =
192 GoogleURLTrackerFactory::GetForProfile(profile_);
193 if (tracker)
194 tracker->RequestServerCheck(true);
195 }
196
197 MarkAsDone(DEFAULT_SEARCH_ENGINE); 185 MarkAsDone(DEFAULT_SEARCH_ENGINE);
198 } else { 186 } else {
199 template_url_service_sub_ = 187 template_url_service_sub_ =
200 template_url_service_->RegisterOnLoadedCallback( 188 template_url_service_->RegisterOnLoadedCallback(
201 base::Bind(&ProfileResetter::OnTemplateURLServiceLoaded, 189 base::Bind(&ProfileResetter::OnTemplateURLServiceLoaded,
202 weak_ptr_factory_.GetWeakPtr())); 190 weak_ptr_factory_.GetWeakPtr()));
203 template_url_service_->Load(); 191 template_url_service_->Load();
204 } 192 }
205 } 193 }
206 194
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 chrome_exe, 369 chrome_exe,
382 false, 370 false,
383 cancel, 371 cancel,
384 &shortcuts); 372 &shortcuts);
385 } 373 }
386 return shortcuts; 374 return shortcuts;
387 #else 375 #else
388 return std::vector<ShortcutCommand>(); 376 return std::vector<ShortcutCommand>();
389 #endif 377 #endif
390 } 378 }
OLDNEW
« no previous file with comments | « no previous file | components/search_engines/template_url_service.cc » ('j') | components/search_engines/template_url_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698