| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/util.h" | 5 #include "chrome/browser/search_engines/util.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/browser_thread.h" | 12 #include "chrome/browser/browser_thread.h" |
| 13 #include "chrome/browser/search_engines/template_url.h" | 13 #include "chrome/browser/search_engines/template_url.h" |
| 14 #include "chrome/browser/search_engines/template_url_model.h" | 14 #include "chrome/browser/search_engines/template_url_model.h" |
| 15 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 15 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| 16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
| 17 #include "chrome/browser/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 | 18 |
| 19 string16 GetDefaultSearchEngineName(Profile* profile) { | 19 string16 GetDefaultSearchEngineName(Profile* profile) { |
| 20 if (!profile) { | 20 if (!profile) { |
| 21 NOTREACHED(); | 21 NOTREACHED(); |
| 22 return string16(); | 22 return string16(); |
| 23 } | 23 } |
| 24 const TemplateURL* const default_provider = | 24 const TemplateURL* const default_provider = |
| 25 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); | 25 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); |
| 26 if (!default_provider) { | 26 if (!default_provider) { |
| 27 // TODO(cpu): bug 1187517. It is possible to have no default provider. | 27 // TODO(cpu): bug 1187517. It is possible to have no default provider. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 if (keyword_result.builtin_keyword_version != resource_keyword_version) { | 193 if (keyword_result.builtin_keyword_version != resource_keyword_version) { |
| 194 MergeEnginesFromPrepopulateData(prefs, service, template_urls, | 194 MergeEnginesFromPrepopulateData(prefs, service, template_urls, |
| 195 default_search_provider); | 195 default_search_provider); |
| 196 *new_resource_keyword_version = resource_keyword_version; | 196 *new_resource_keyword_version = resource_keyword_version; |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| OLD | NEW |