Index: chrome/browser/search_engines/template_url_prepopulate_data.cc |
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc |
index a3e93e13954ebab8a94291739b9accd643bc0f92..bb463eb918f70d3331e0cc4b1e99c9b17f7085bc 100644 |
--- a/chrome/browser/search_engines/template_url_prepopulate_data.cc |
+++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc |
@@ -32,93 +32,24 @@ |
#include "grit/theme_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
+#include "prepopulated_engines.h" |
+ |
#if defined(OS_WIN) |
#undef IN // On Windows, windef.h defines this, which screws up "India" cases. |
#elif defined(OS_MACOSX) |
#include "base/mac/scoped_cftyperef.h" |
#endif |
-namespace { |
+namespace TemplateURLPrepopulateData { |
// NOTE: See comments in GetDataVersion() below! You should probably not change |
// the data in this file without changing the result of that function! |
-// Engine definitions ////////////////////////////////////////////////////////// |
- |
-struct PrepopulatedEngine { |
- const wchar_t* const name; |
- const wchar_t* const keyword; |
- const char* const favicon_url; // If NULL, there is no favicon. |
- const char* const search_url; |
- const char* const encoding; |
- const char* const suggest_url; // If NULL, this engine does not support |
- // suggestions. |
- const char* const instant_url; // If NULL, this engine does not support |
- // instant. |
- // A JSON array containing a list of URL patterns that can be used, in |
- // addition to |search_url|, to extract search terms from a URL. Can be NULL. |
- const char* const alternate_urls; |
- // SEARCH_ENGINE_OTHER if there is no matching type. |
- const SearchEngineType type; |
- // Unique id for this prepopulate engine (corresponds to |
- // TemplateURL::prepopulate_id). This ID must be greater than zero and must |
- // remain the same for a particular site regardless of how the url changes; |
- // the ID is used when modifying engine data in subsequent versions, so that |
- // we can find the "old" entry to update even when the name or URL changes. |
- // |
- // This ID must be "unique" within one country's prepopulated data, but two |
- // entries can share an ID if they represent the "same" engine (e.g. Yahoo! US |
- // vs. Yahoo! UK) and will not appear in the same user-visible data set. This |
- // facilitates changes like adding more specific per-country data in the |
- // future; in such a case the localized engines will transparently replace the |
- // previous, non-localized versions. For engines where we need two instances |
- // to appear for one country (e.g. Bing Search U.S. English and Spanish), we |
- // must use two different unique IDs (and different keywords). |
- // |
- // The following unique IDs are available: |
- // 53, 56, 58, 60, 61, 64, 65, 66, 70, 74, 78, 79, 80, 81, 84, 86, 88, 91, |
- // 92, 93, 94, 95, 96, 97, 98, 99, 102+ |
- // |
- // IDs > 1000 are reserved for distribution custom engines. |
- // |
- // NOTES: |
- // CHANGE THE ABOVE NUMBERS IF YOU ADD A NEW ENGINE; ID conflicts = bad! |
- // CHANGE kMaxPrepopulatedEngineID below if you add new engine outside |
- // of the current range or it will not be counted in stats. |
- const int id; |
-}; |
- |
// Prepopulated engines //////////////////////////////////////////////////////// |
// The following engines are included in country lists and are added to the list |
// of search engines on the first run depending on user's country. |
-const PrepopulatedEngine abcsok = { |
- L"ABC S\x00f8k", |
- L"abcsok.no", |
- "http://abcsok.no/favicon.ico", |
- "http://abcsok.no/index.html?q={searchTerms}", |
- "UTF-8", |
- NULL, |
- NULL, |
- NULL, |
- SEARCH_ENGINE_ABCSOK, |
- 72, |
-}; |
- |
-const PrepopulatedEngine altavista = { |
- L"AltaVista", |
- L"altavista.com", |
- "http://www.altavista.com/favicon.ico", |
- "http://www.altavista.com/web/results?q={searchTerms}", |
- "UTF-8", |
- NULL, |
- NULL, |
- NULL, |
- SEARCH_ENGINE_ALTAVISTA, |
- 89, |
-}; |
- |
const PrepopulatedEngine altavista_ar = { |
L"AltaVista", |
L"ar.altavista.com", |
@@ -1174,27 +1105,6 @@ const PrepopulatedEngine goo = { |
23, |
}; |
-const PrepopulatedEngine google = { |
- L"Google", |
- L"google.com", // This will be dynamically updated by the TemplateURL system. |
- "http://www.google.com/favicon.ico", |
- "{google:baseURL}search?q={searchTerms}&{google:RLZ}" |
- "{google:acceptedSuggestion}{google:originalQueryForSuggestion}" |
- "{google:assistedQueryStats}{google:searchFieldtrialParameter}" |
- "sourceid=chrome&ie={inputEncoding}", |
- "UTF-8", |
- "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}" |
- "client=chrome&hl={language}&q={searchTerms}&" |
- "sugkey={google:suggestAPIKeyParameter}", |
- "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}" |
- "{google:instantEnabledParameter}ie={inputEncoding}", |
- "[\"{google:baseURL}#q={searchTerms}\", " |
- "\"{google:baseURL}search#q={searchTerms}\", " |
- "\"{google:baseURL}webhp#q={searchTerms}\"]", |
- SEARCH_ENGINE_GOOGLE, |
- 1, |
-}; |
- |
const PrepopulatedEngine guruji = { |
L"guruji", |
L"guruji.com", |
@@ -3484,10 +3394,6 @@ const LogoURLs google_logos = { |
//////////////////////////////////////////////////////////////////////////////// |
-} // namespace |
- |
-namespace TemplateURLPrepopulateData { |
- |
// The following id is for UMA stats only. Please update |
// kMaxPrepopulatedEngineID if it changes upwards. |
const int kMaxPrepopulatedEngineID = 101; |
@@ -3508,9 +3414,6 @@ void RegisterUserPrefs(PrefService* prefs) { |
} |
int GetDataVersion(PrefService* prefs) { |
- // Increment this if you change the above data in ways that mean users with |
- // existing data should get a new version. |
- const int kCurrentDataVersion = 45; |
// Allow tests to override the local version. |
return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? |
prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : |