OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.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_prepopulate_data.h" | 14 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
15 #include "chrome/browser/search_engines/template_url_service.h" | 15 #include "chrome/browser/search_engines/template_url_service.h" |
16 #include "chrome/browser/search_engines/template_url_service_factory.h" | 16 #include "chrome/browser/search_engines/template_url_service_factory.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 | 18 |
| 19 using content::BrowserThread; |
| 20 |
19 string16 GetDefaultSearchEngineName(Profile* profile) { | 21 string16 GetDefaultSearchEngineName(Profile* profile) { |
20 if (!profile) { | 22 if (!profile) { |
21 NOTREACHED(); | 23 NOTREACHED(); |
22 return string16(); | 24 return string16(); |
23 } | 25 } |
24 const TemplateURL* const default_provider = | 26 const TemplateURL* const default_provider = |
25 TemplateURLServiceFactory::GetForProfile(profile)-> | 27 TemplateURLServiceFactory::GetForProfile(profile)-> |
26 GetDefaultSearchProvider(); | 28 GetDefaultSearchProvider(); |
27 if (!default_provider) { | 29 if (!default_provider) { |
28 // TODO(cpu): bug 1187517. It is possible to have no default provider. | 30 // TODO(cpu): bug 1187517. It is possible to have no default provider. |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 222 |
221 if (!keyword_result.did_default_search_provider_change) | 223 if (!keyword_result.did_default_search_provider_change) |
222 return false; | 224 return false; |
223 | 225 |
224 *backup_default_search_provider = GetTemplateURLByID( | 226 *backup_default_search_provider = GetTemplateURLByID( |
225 template_urls, | 227 template_urls, |
226 keyword_result.default_search_provider_id_backup); | 228 keyword_result.default_search_provider_id_backup); |
227 return true; | 229 return true; |
228 } | 230 } |
229 | 231 |
OLD | NEW |