| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 default_search_manager_( | 270 default_search_manager_( |
| 271 prefs_, | 271 prefs_, |
| 272 base::Bind(&TemplateURLService::OnDefaultSearchChange, | 272 base::Bind(&TemplateURLService::OnDefaultSearchChange, |
| 273 base::Unretained(this))) { | 273 base::Unretained(this))) { |
| 274 Init(initializers, count); | 274 Init(initializers, count); |
| 275 } | 275 } |
| 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 base::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) | 286 #if defined(OS_IOS) || defined(OS_ANDROID) |
| 287 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; | 287 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; |
| 288 #else | 288 #else |
| 289 uint32_t flags = user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; | 289 uint32_t flags = user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; |
| 290 #endif | 290 #endif |
| (...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2473 | 2473 |
| 2474 if (most_recently_intalled_default) { | 2474 if (most_recently_intalled_default) { |
| 2475 base::AutoReset<DefaultSearchChangeOrigin> change_origin( | 2475 base::AutoReset<DefaultSearchChangeOrigin> change_origin( |
| 2476 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); | 2476 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); |
| 2477 default_search_manager_.SetExtensionControlledDefaultSearchEngine( | 2477 default_search_manager_.SetExtensionControlledDefaultSearchEngine( |
| 2478 most_recently_intalled_default->data()); | 2478 most_recently_intalled_default->data()); |
| 2479 } else { | 2479 } else { |
| 2480 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); | 2480 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); |
| 2481 } | 2481 } |
| 2482 } | 2482 } |
| OLD | NEW |