| 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/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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1179 const PrepopulatedEngine google = { | 1179 const PrepopulatedEngine google = { | 
| 1180   L"Google", | 1180   L"Google", | 
| 1181   NULL, | 1181   NULL, | 
| 1182   "http://www.google.com/favicon.ico", | 1182   "http://www.google.com/favicon.ico", | 
| 1183   L"{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}" | 1183   L"{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}" | 
| 1184       L"{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}&" | 1184       L"{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}&" | 
| 1185       L"q={searchTerms}", | 1185       L"q={searchTerms}", | 
| 1186   "UTF-8", | 1186   "UTF-8", | 
| 1187   L"{google:baseSuggestURL}search?client=chrome&hl={language}&q={searchTerms}", | 1187   L"{google:baseSuggestURL}search?client=chrome&hl={language}&q={searchTerms}", | 
| 1188   L"{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant" | 1188   L"{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant" | 
| 1189       L"&ie={inputEncoding}&ion=1{searchTerms}", | 1189       L"&ie={inputEncoding}&ion=1{searchTerms}&nord=1", | 
| 1190   SEARCH_ENGINE_GOOGLE, | 1190   SEARCH_ENGINE_GOOGLE, | 
| 1191   IDR_SEARCH_ENGINE_LOGO_GOOGLE, | 1191   IDR_SEARCH_ENGINE_LOGO_GOOGLE, | 
| 1192   1, | 1192   1, | 
| 1193 }; | 1193 }; | 
| 1194 | 1194 | 
| 1195 const PrepopulatedEngine guruji = { | 1195 const PrepopulatedEngine guruji = { | 
| 1196   L"guruji", | 1196   L"guruji", | 
| 1197   L"guruji.com", | 1197   L"guruji.com", | 
| 1198   "http://guruji.com/favicon.ico", | 1198   "http://guruji.com/favicon.ico", | 
| 1199   L"http://guruji.com/search?q={searchTerms}", | 1199   L"http://guruji.com/search?q={searchTerms}", | 
| (...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3344   prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown); | 3344   prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown); | 
| 3345   prefs->RegisterListPref(prefs::kSearchProviderOverrides); | 3345   prefs->RegisterListPref(prefs::kSearchProviderOverrides); | 
| 3346   prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, -1); | 3346   prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, -1); | 
| 3347   // Obsolete pref, for migration. | 3347   // Obsolete pref, for migration. | 
| 3348   prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, -1); | 3348   prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, -1); | 
| 3349 } | 3349 } | 
| 3350 | 3350 | 
| 3351 int GetDataVersion(PrefService* prefs) { | 3351 int GetDataVersion(PrefService* prefs) { | 
| 3352   // Increment this if you change the above data in ways that mean users with | 3352   // Increment this if you change the above data in ways that mean users with | 
| 3353   // existing data should get a new version. | 3353   // existing data should get a new version. | 
| 3354   const int kCurrentDataVersion = 32; | 3354   const int kCurrentDataVersion = 33; | 
| 3355   if (!prefs) | 3355   if (!prefs) | 
| 3356     return kCurrentDataVersion; | 3356     return kCurrentDataVersion; | 
| 3357   // If a version number exist in the preferences file, it overrides the | 3357   // If a version number exist in the preferences file, it overrides the | 
| 3358   // version of the built-in data. | 3358   // version of the built-in data. | 
| 3359   int version = | 3359   int version = | 
| 3360     prefs->GetInteger(prefs::kSearchProviderOverridesVersion); | 3360     prefs->GetInteger(prefs::kSearchProviderOverridesVersion); | 
| 3361   return (version >= 0) ? version : kCurrentDataVersion; | 3361   return (version >= 0) ? version : kCurrentDataVersion; | 
| 3362 } | 3362 } | 
| 3363 | 3363 | 
| 3364 TemplateURL* MakePrepopulatedTemplateURL(const wchar_t* name, | 3364 TemplateURL* MakePrepopulatedTemplateURL(const wchar_t* name, | 
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3565   for (size_t i = 0; i < arraysize(kAllEngines); ++i) { | 3565   for (size_t i = 0; i < arraysize(kAllEngines); ++i) { | 
| 3566     std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); | 3566     std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); | 
| 3567     GURL url(url_utf8_string); | 3567     GURL url(url_utf8_string); | 
| 3568     if (origin_to_find == url.GetOrigin()) | 3568     if (origin_to_find == url.GetOrigin()) | 
| 3569       return kAllEngines[i]->logo_id; | 3569       return kAllEngines[i]->logo_id; | 
| 3570   } | 3570   } | 
| 3571   return kNoSearchEngineLogo; | 3571   return kNoSearchEngineLogo; | 
| 3572 } | 3572 } | 
| 3573 | 3573 | 
| 3574 }  // namespace TemplateURLPrepopulateData | 3574 }  // namespace TemplateURLPrepopulateData | 
| OLD | NEW | 
|---|