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/default_search_manager.h" | 5 #include "components/search_engines/default_search_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 LoadPrepopulatedDefaultSearch(); | 93 LoadPrepopulatedDefaultSearch(); |
94 LoadDefaultSearchEngineFromPrefs(); | 94 LoadDefaultSearchEngineFromPrefs(); |
95 } | 95 } |
96 | 96 |
97 DefaultSearchManager::~DefaultSearchManager() { | 97 DefaultSearchManager::~DefaultSearchManager() { |
98 } | 98 } |
99 | 99 |
100 // static | 100 // static |
101 void DefaultSearchManager::RegisterProfilePrefs( | 101 void DefaultSearchManager::RegisterProfilePrefs( |
102 user_prefs::PrefRegistrySyncable* registry) { | 102 user_prefs::PrefRegistrySyncable* registry) { |
103 registry->RegisterDictionaryPref( | 103 registry->RegisterDictionaryPref(kDefaultSearchProviderDataPrefName); |
104 kDefaultSearchProviderDataPrefName, | |
105 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
106 } | 104 } |
107 | 105 |
108 // static | 106 // static |
109 void DefaultSearchManager::AddPrefValueToMap(base::DictionaryValue* value, | 107 void DefaultSearchManager::AddPrefValueToMap(base::DictionaryValue* value, |
110 PrefValueMap* pref_value_map) { | 108 PrefValueMap* pref_value_map) { |
111 pref_value_map->SetValue(kDefaultSearchProviderDataPrefName, value); | 109 pref_value_map->SetValue(kDefaultSearchProviderDataPrefName, value); |
112 } | 110 } |
113 | 111 |
114 // static | 112 // static |
115 void DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting( | 113 void DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting( |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 MergePrefsDataWithPrepopulated(); | 404 MergePrefsDataWithPrepopulated(); |
407 } | 405 } |
408 | 406 |
409 void DefaultSearchManager::NotifyObserver() { | 407 void DefaultSearchManager::NotifyObserver() { |
410 if (!change_observer_.is_null()) { | 408 if (!change_observer_.is_null()) { |
411 Source source = FROM_FALLBACK; | 409 Source source = FROM_FALLBACK; |
412 TemplateURLData* data = GetDefaultSearchEngine(&source); | 410 TemplateURLData* data = GetDefaultSearchEngine(&source); |
413 change_observer_.Run(data, source); | 411 change_observer_.Run(data, source); |
414 } | 412 } |
415 } | 413 } |
OLD | NEW |