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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
11 #include "base/synchronization/cancellation_flag.h" | 11 #include "base/synchronization/cancellation_flag.h" |
12 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 12 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/google/google_url_tracker_factory.h" | 14 #include "chrome/browser/google/google_url_tracker_factory.h" |
15 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" | 15 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/search_engines/template_url_service_factory.h" | 17 #include "chrome/browser/search_engines/template_url_service_factory.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_iterator.h" | 19 #include "chrome/browser/ui/browser_iterator.h" |
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
22 #include "chrome/installer/util/browser_distribution.h" | 22 #include "chrome/installer/util/browser_distribution.h" |
23 #include "components/content_settings/core/browser/host_content_settings_map.h" | 23 #include "components/content_settings/core/browser/host_content_settings_map.h" |
24 #include "components/google/core/browser/google_pref_names.h" | |
25 #include "components/google/core/browser/google_url_tracker.h" | 24 #include "components/google/core/browser/google_url_tracker.h" |
26 #include "components/search_engines/search_engines_pref_names.h" | 25 #include "components/search_engines/search_engines_pref_names.h" |
27 #include "components/search_engines/template_url_prepopulate_data.h" | 26 #include "components/search_engines/template_url_prepopulate_data.h" |
28 #include "components/search_engines/template_url_service.h" | 27 #include "components/search_engines/template_url_service.h" |
29 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
30 #include "extensions/browser/extension_system.h" | 29 #include "extensions/browser/extension_system.h" |
31 #include "extensions/browser/management_policy.h" | 30 #include "extensions/browser/management_policy.h" |
32 | 31 |
33 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
34 #include "base/base_paths.h" | 33 #include "base/base_paths.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (search_engines) { | 163 if (search_engines) { |
165 // This Chrome distribution channel provides a custom search engine. We | 164 // This Chrome distribution channel provides a custom search engine. We |
166 // must reset to it. | 165 // must reset to it. |
167 ListPrefUpdate update(prefs, prefs::kSearchProviderOverrides); | 166 ListPrefUpdate update(prefs, prefs::kSearchProviderOverrides); |
168 update->Swap(search_engines.get()); | 167 update->Swap(search_engines.get()); |
169 } | 168 } |
170 | 169 |
171 template_url_service_->RepairPrepopulatedSearchEngines(); | 170 template_url_service_->RepairPrepopulatedSearchEngines(); |
172 | 171 |
173 // Reset Google search URL. | 172 // Reset Google search URL. |
174 prefs->ClearPref(prefs::kLastPromptedGoogleURL); | |
175 const TemplateURL* default_search_provider = | 173 const TemplateURL* default_search_provider = |
176 template_url_service_->GetDefaultSearchProvider(); | 174 template_url_service_->GetDefaultSearchProvider(); |
177 if (default_search_provider && | 175 if (default_search_provider && |
178 default_search_provider->HasGoogleBaseURLs( | 176 default_search_provider->HasGoogleBaseURLs( |
179 template_url_service_->search_terms_data())) { | 177 template_url_service_->search_terms_data())) { |
180 GoogleURLTracker* tracker = | 178 GoogleURLTracker* tracker = |
181 GoogleURLTrackerFactory::GetForProfile(profile_); | 179 GoogleURLTrackerFactory::GetForProfile(profile_); |
182 if (tracker) | 180 if (tracker) |
183 tracker->RequestServerCheck(true); | 181 tracker->RequestServerCheck(true); |
184 } | 182 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 chrome_exe, | 346 chrome_exe, |
349 false, | 347 false, |
350 cancel, | 348 cancel, |
351 &shortcuts); | 349 &shortcuts); |
352 } | 350 } |
353 return shortcuts; | 351 return shortcuts; |
354 #else | 352 #else |
355 return std::vector<ShortcutCommand>(); | 353 return std::vector<ShortcutCommand>(); |
356 #endif | 354 #endif |
357 } | 355 } |
OLD | NEW |