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/template_url_prepopulate_data.h" | 5 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
6 | 6 |
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
8 #include <locale.h> | 8 #include <locale.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3393 new_turl->set_keyword(WideToUTF16Hack(keyword)); | 3393 new_turl->set_keyword(WideToUTF16Hack(keyword)); |
3394 new_turl->set_show_in_default_list(true); | 3394 new_turl->set_show_in_default_list(true); |
3395 new_turl->set_safe_for_autoreplace(true); | 3395 new_turl->set_safe_for_autoreplace(true); |
3396 new_turl->set_date_created(Time()); | 3396 new_turl->set_date_created(Time()); |
3397 new_turl->set_last_modified(Time()); | 3397 new_turl->set_last_modified(Time()); |
3398 std::vector<std::string> turl_encodings; | 3398 std::vector<std::string> turl_encodings; |
3399 turl_encodings.push_back(encoding); | 3399 turl_encodings.push_back(encoding); |
3400 new_turl->set_input_encodings(turl_encodings); | 3400 new_turl->set_input_encodings(turl_encodings); |
3401 new_turl->set_search_engine_type(search_engine_type); | 3401 new_turl->set_search_engine_type(search_engine_type); |
3402 new_turl->set_logo_id(logo_id); | 3402 new_turl->set_logo_id(logo_id); |
3403 new_turl->set_prepopulate_id(id); | 3403 new_turl->SetPrepopulateId(id); |
3404 return new_turl; | 3404 return new_turl; |
3405 } | 3405 } |
3406 | 3406 |
3407 void GetPrepopulatedTemplateFromPrefs(PrefService* prefs, | 3407 void GetPrepopulatedTemplateFromPrefs(PrefService* prefs, |
3408 std::vector<TemplateURL*>* t_urls) { | 3408 std::vector<TemplateURL*>* t_urls) { |
3409 if (!prefs) | 3409 if (!prefs) |
3410 return; | 3410 return; |
3411 | 3411 |
3412 const ListValue* list = | 3412 const ListValue* list = |
3413 prefs->GetList(prefs::kSearchProviderOverrides); | 3413 prefs->GetList(prefs::kSearchProviderOverrides); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3573 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { | 3573 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { |
3574 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); | 3574 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); |
3575 GURL url(url_utf8_string); | 3575 GURL url(url_utf8_string); |
3576 if (origin_to_find == url.GetOrigin()) | 3576 if (origin_to_find == url.GetOrigin()) |
3577 return kAllEngines[i]->logo_id; | 3577 return kAllEngines[i]->logo_id; |
3578 } | 3578 } |
3579 return kNoSearchEngineLogo; | 3579 return kNoSearchEngineLogo; |
3580 } | 3580 } |
3581 | 3581 |
3582 } // namespace TemplateURLPrepopulateData | 3582 } // namespace TemplateURLPrepopulateData |
OLD | NEW |