| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |