| 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_pref_migration.h" | 5 #include "components/search_engines/default_search_pref_migration.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram_macros.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "components/prefs/pref_service.h" | 19 #include "components/prefs/pref_service.h" |
| 20 #include "components/search_engines/default_search_manager.h" | 20 #include "components/search_engines/default_search_manager.h" |
| 21 #include "components/search_engines/search_engines_pref_names.h" | 21 #include "components/search_engines/search_engines_pref_names.h" |
| 22 #include "components/search_engines/template_url_data.h" | 22 #include "components/search_engines/template_url_data.h" |
| 23 #include "components/search_engines/template_url_service.h" | 23 #include "components/search_engines/template_url_service.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void ConfigureDefaultSearchPrefMigrationToDictionaryValue( | 161 void ConfigureDefaultSearchPrefMigrationToDictionaryValue( |
| 162 PrefService* pref_service) { | 162 PrefService* pref_service) { |
| 163 if (pref_service->GetInitializationStatus() == | 163 if (pref_service->GetInitializationStatus() == |
| 164 PrefService::INITIALIZATION_STATUS_WAITING) { | 164 PrefService::INITIALIZATION_STATUS_WAITING) { |
| 165 pref_service->AddPrefInitObserver( | 165 pref_service->AddPrefInitObserver( |
| 166 base::Bind(&OnPrefsInitialized, base::Unretained(pref_service))); | 166 base::Bind(&OnPrefsInitialized, base::Unretained(pref_service))); |
| 167 } else { | 167 } else { |
| 168 MigrateDefaultSearchPref(pref_service); | 168 MigrateDefaultSearchPref(pref_service); |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |