| 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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/prefs/scoped_user_pref_update.h" | 8 #include "base/prefs/scoped_user_pref_update.h" |
| 9 #include "base/synchronization/cancellation_flag.h" | 9 #include "base/synchronization/cancellation_flag.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 11 #include "chrome/browser/content_settings/host_content_settings_map.h" | 11 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/google/google_url_tracker.h" | 13 #include "chrome/browser/google/google_url_tracker.h" |
| 14 #include "chrome/browser/google/google_url_tracker_factory.h" |
| 14 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" | 15 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/search_engines/search_terms_data.h" | 17 #include "chrome/browser/search_engines/search_terms_data.h" |
| 17 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 18 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| 18 #include "chrome/browser/search_engines/template_url_service.h" | 19 #include "chrome/browser/search_engines/template_url_service.h" |
| 19 #include "chrome/browser/search_engines/template_url_service_factory.h" | 20 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 20 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
| 21 #include "chrome/browser/ui/browser_iterator.h" | 22 #include "chrome/browser/ui/browser_iterator.h" |
| 22 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 23 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 23 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 update->Swap(search_engines.get()); | 165 update->Swap(search_engines.get()); |
| 165 } | 166 } |
| 166 | 167 |
| 167 template_url_service_->RepairPrepopulatedSearchEngines(); | 168 template_url_service_->RepairPrepopulatedSearchEngines(); |
| 168 | 169 |
| 169 // Reset Google search URL. | 170 // Reset Google search URL. |
| 170 prefs->ClearPref(prefs::kLastPromptedGoogleURL); | 171 prefs->ClearPref(prefs::kLastPromptedGoogleURL); |
| 171 const TemplateURL* default_search_provider = | 172 const TemplateURL* default_search_provider = |
| 172 template_url_service_->GetDefaultSearchProvider(); | 173 template_url_service_->GetDefaultSearchProvider(); |
| 173 if (default_search_provider && | 174 if (default_search_provider && |
| 174 default_search_provider->HasGoogleBaseURLs()) | 175 default_search_provider->HasGoogleBaseURLs()) { |
| 175 GoogleURLTracker::RequestServerCheck(profile_, true); | 176 GoogleURLTracker* tracker = |
| 177 GoogleURLTrackerFactory::GetForProfile(profile_); |
| 178 if (tracker) |
| 179 tracker->RequestServerCheck(true); |
| 180 } |
| 176 | 181 |
| 177 MarkAsDone(DEFAULT_SEARCH_ENGINE); | 182 MarkAsDone(DEFAULT_SEARCH_ENGINE); |
| 178 } else { | 183 } else { |
| 179 template_url_service_sub_ = | 184 template_url_service_sub_ = |
| 180 template_url_service_->RegisterOnLoadedCallback( | 185 template_url_service_->RegisterOnLoadedCallback( |
| 181 base::Bind(&ProfileResetter::OnTemplateURLServiceLoaded, | 186 base::Bind(&ProfileResetter::OnTemplateURLServiceLoaded, |
| 182 weak_ptr_factory_.GetWeakPtr())); | 187 weak_ptr_factory_.GetWeakPtr())); |
| 183 template_url_service_->Load(); | 188 template_url_service_->Load(); |
| 184 } | 189 } |
| 185 } | 190 } |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 chrome_exe, | 343 chrome_exe, |
| 339 false, | 344 false, |
| 340 cancel, | 345 cancel, |
| 341 &shortcuts); | 346 &shortcuts); |
| 342 } | 347 } |
| 343 return shortcuts; | 348 return shortcuts; |
| 344 #else | 349 #else |
| 345 return std::vector<ShortcutCommand>(); | 350 return std::vector<ShortcutCommand>(); |
| 346 #endif | 351 #endif |
| 347 } | 352 } |
| OLD | NEW |