OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/search_engines/template_url_service.h" | 5 #include "components/search_engines/template_url_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 TemplateURLService::~TemplateURLService() { | 277 TemplateURLService::~TemplateURLService() { |
278 // |web_data_service_| should be deleted during Shutdown(). | 278 // |web_data_service_| should be deleted during Shutdown(). |
279 DCHECK(!web_data_service_.get()); | 279 DCHECK(!web_data_service_.get()); |
280 STLDeleteElements(&template_urls_); | 280 STLDeleteElements(&template_urls_); |
281 } | 281 } |
282 | 282 |
283 // static | 283 // static |
284 void TemplateURLService::RegisterProfilePrefs( | 284 void TemplateURLService::RegisterProfilePrefs( |
285 user_prefs::PrefRegistrySyncable* registry) { | 285 user_prefs::PrefRegistrySyncable* registry) { |
| 286 #if defined(OS_IOS) || defined(OS_ANDROID) |
| 287 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; |
| 288 #else |
| 289 uint32_t flags = user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; |
| 290 #endif |
286 registry->RegisterStringPref(prefs::kSyncedDefaultSearchProviderGUID, | 291 registry->RegisterStringPref(prefs::kSyncedDefaultSearchProviderGUID, |
287 std::string(), | 292 std::string(), |
288 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 293 flags); |
289 registry->RegisterBooleanPref(prefs::kDefaultSearchProviderEnabled, true); | 294 registry->RegisterBooleanPref(prefs::kDefaultSearchProviderEnabled, true); |
290 registry->RegisterStringPref(prefs::kDefaultSearchProviderName, | 295 registry->RegisterStringPref(prefs::kDefaultSearchProviderName, |
291 std::string()); | 296 std::string()); |
292 registry->RegisterStringPref(prefs::kDefaultSearchProviderID, std::string()); | 297 registry->RegisterStringPref(prefs::kDefaultSearchProviderID, std::string()); |
293 registry->RegisterStringPref(prefs::kDefaultSearchProviderPrepopulateID, | 298 registry->RegisterStringPref(prefs::kDefaultSearchProviderPrepopulateID, |
294 std::string()); | 299 std::string()); |
295 registry->RegisterStringPref(prefs::kDefaultSearchProviderSuggestURL, | 300 registry->RegisterStringPref(prefs::kDefaultSearchProviderSuggestURL, |
296 std::string()); | 301 std::string()); |
297 registry->RegisterStringPref(prefs::kDefaultSearchProviderSearchURL, | 302 registry->RegisterStringPref(prefs::kDefaultSearchProviderSearchURL, |
298 std::string()); | 303 std::string()); |
(...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 | 2473 |
2469 if (most_recently_intalled_default) { | 2474 if (most_recently_intalled_default) { |
2470 base::AutoReset<DefaultSearchChangeOrigin> change_origin( | 2475 base::AutoReset<DefaultSearchChangeOrigin> change_origin( |
2471 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); | 2476 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); |
2472 default_search_manager_.SetExtensionControlledDefaultSearchEngine( | 2477 default_search_manager_.SetExtensionControlledDefaultSearchEngine( |
2473 most_recently_intalled_default->data()); | 2478 most_recently_intalled_default->data()); |
2474 } else { | 2479 } else { |
2475 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); | 2480 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); |
2476 } | 2481 } |
2477 } | 2482 } |
OLD | NEW |