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 "chrome/browser/search_engines/default_search_manager.h" | 5 #include "chrome/browser/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 DefaultSearchManager::~DefaultSearchManager() { | 94 DefaultSearchManager::~DefaultSearchManager() { |
95 } | 95 } |
96 | 96 |
97 // static | 97 // static |
98 void DefaultSearchManager::RegisterProfilePrefs( | 98 void DefaultSearchManager::RegisterProfilePrefs( |
99 user_prefs::PrefRegistrySyncable* registry) { | 99 user_prefs::PrefRegistrySyncable* registry) { |
100 registry->RegisterDictionaryPref( | 100 registry->RegisterDictionaryPref( |
101 kDefaultSearchProviderDataPrefName, | 101 kDefaultSearchProviderDataPrefName, |
102 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 102 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
103 } | 103 } |
104 | 104 |
105 // static | 105 // static |
106 void DefaultSearchManager::AddPrefValueToMap(base::DictionaryValue* value, | 106 void DefaultSearchManager::AddPrefValueToMap(base::DictionaryValue* value, |
107 PrefValueMap* pref_value_map) { | 107 PrefValueMap* pref_value_map) { |
108 pref_value_map->SetValue(kDefaultSearchProviderDataPrefName, value); | 108 pref_value_map->SetValue(kDefaultSearchProviderDataPrefName, value); |
109 } | 109 } |
110 | 110 |
111 TemplateURLData* DefaultSearchManager::GetDefaultSearchEngine( | 111 TemplateURLData* DefaultSearchManager::GetDefaultSearchEngine( |
112 Source* source) const { | 112 Source* source) const { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 MergePrefsDataWithPrepopulated(); | 396 MergePrefsDataWithPrepopulated(); |
397 } | 397 } |
398 | 398 |
399 void DefaultSearchManager::NotifyObserver() { | 399 void DefaultSearchManager::NotifyObserver() { |
400 if (!change_observer_.is_null()) { | 400 if (!change_observer_.is_null()) { |
401 Source source = FROM_FALLBACK; | 401 Source source = FROM_FALLBACK; |
402 TemplateURLData* data = GetDefaultSearchEngine(&source); | 402 TemplateURLData* data = GetDefaultSearchEngine(&source); |
403 change_observer_.Run(data, source); | 403 change_observer_.Run(data, source); |
404 } | 404 } |
405 } | 405 } |
OLD | NEW |