| 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 3572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3583 GURL origin_to_find = url_to_find.GetOrigin(); | 3583 GURL origin_to_find = url_to_find.GetOrigin(); |
| 3584 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { | 3584 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { |
| 3585 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); | 3585 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); |
| 3586 GURL url(url_utf8_string); | 3586 GURL url(url_utf8_string); |
| 3587 if (origin_to_find == url.GetOrigin()) | 3587 if (origin_to_find == url.GetOrigin()) |
| 3588 return kAllEngines[i]->logo_id; | 3588 return kAllEngines[i]->logo_id; |
| 3589 } | 3589 } |
| 3590 return kNoSearchEngineLogo; | 3590 return kNoSearchEngineLogo; |
| 3591 } | 3591 } |
| 3592 | 3592 |
| 3593 TemplateURL* FindPrepopulatedEngine(const std::string& search_url) { |
| 3594 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { |
| 3595 if (search_url == ToUTF8(kAllEngines[i]->search_url)) |
| 3596 return MakePrepopulateTemplateURLFromPrepopulateEngine(*kAllEngines[i]); |
| 3597 } |
| 3598 return NULL; |
| 3599 } |
| 3600 |
| 3593 } // namespace TemplateURLPrepopulateData | 3601 } // namespace TemplateURLPrepopulateData |
| OLD | NEW |