| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 const PrepopulatedEngine google = { | 1090 const PrepopulatedEngine google = { |
| 1091 L"Google", | 1091 L"Google", |
| 1092 L"google.com", // This will be dynamically updated by the TemplateURL system. | 1092 L"google.com", // This will be dynamically updated by the TemplateURL system. |
| 1093 "http://www.google.com/favicon.ico", | 1093 "http://www.google.com/favicon.ico", |
| 1094 "{google:baseURL}search?q={searchTerms}&{google:RLZ}" | 1094 "{google:baseURL}search?q={searchTerms}&{google:RLZ}" |
| 1095 "{google:acceptedSuggestion}{google:originalQueryForSuggestion}" | 1095 "{google:acceptedSuggestion}{google:originalQueryForSuggestion}" |
| 1096 "{google:assistedQueryStats}{google:searchFieldtrialParameter}" | 1096 "{google:assistedQueryStats}{google:searchFieldtrialParameter}" |
| 1097 "sourceid=chrome&ie={inputEncoding}", | 1097 "sourceid=chrome&ie={inputEncoding}", |
| 1098 "UTF-8", | 1098 "UTF-8", |
| 1099 "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}" | 1099 "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}" |
| 1100 "client=chrome&hl={language}&q={searchTerms}", | 1100 "client=chrome&hl={language}&q={searchTerms}&" |
| 1101 "sugkey={google:suggestAPIKeyParameter}", |
| 1101 "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}" | 1102 "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}" |
| 1102 "{google:instantEnabledParameter}ie={inputEncoding}", | 1103 "{google:instantEnabledParameter}ie={inputEncoding}", |
| 1103 SEARCH_ENGINE_GOOGLE, | 1104 SEARCH_ENGINE_GOOGLE, |
| 1104 1, | 1105 1, |
| 1105 }; | 1106 }; |
| 1106 | 1107 |
| 1107 const PrepopulatedEngine guruji = { | 1108 const PrepopulatedEngine guruji = { |
| 1108 L"guruji", | 1109 L"guruji", |
| 1109 L"guruji.com", | 1110 L"guruji.com", |
| 1110 "http://guruji.com/favicon.ico", | 1111 "http://guruji.com/favicon.ico", |
| (...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3321 PrefService::UNSYNCABLE_PREF); | 3322 PrefService::UNSYNCABLE_PREF); |
| 3322 // Obsolete pref, for migration. | 3323 // Obsolete pref, for migration. |
| 3323 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, | 3324 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, |
| 3324 -1, | 3325 -1, |
| 3325 PrefService::UNSYNCABLE_PREF); | 3326 PrefService::UNSYNCABLE_PREF); |
| 3326 } | 3327 } |
| 3327 | 3328 |
| 3328 int GetDataVersion(PrefService* prefs) { | 3329 int GetDataVersion(PrefService* prefs) { |
| 3329 // Increment this if you change the above data in ways that mean users with | 3330 // Increment this if you change the above data in ways that mean users with |
| 3330 // existing data should get a new version. | 3331 // existing data should get a new version. |
| 3331 const int kCurrentDataVersion = 42; | 3332 const int kCurrentDataVersion = 43; |
| 3332 // Allow tests to override the local version. | 3333 // Allow tests to override the local version. |
| 3333 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? | 3334 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? |
| 3334 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : | 3335 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : |
| 3335 kCurrentDataVersion; | 3336 kCurrentDataVersion; |
| 3336 } | 3337 } |
| 3337 | 3338 |
| 3338 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, | 3339 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, |
| 3339 const string16& name, | 3340 const string16& name, |
| 3340 const string16& keyword, | 3341 const string16& keyword, |
| 3341 const base::StringPiece& search_url, | 3342 const base::StringPiece& search_url, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3504 g_country_code_at_install = kCountryIDUnknown; | 3505 g_country_code_at_install = kCountryIDUnknown; |
| 3505 } else { | 3506 } else { |
| 3506 g_country_code_at_install = | 3507 g_country_code_at_install = |
| 3507 CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]); | 3508 CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]); |
| 3508 } | 3509 } |
| 3509 } | 3510 } |
| 3510 | 3511 |
| 3511 #endif | 3512 #endif |
| 3512 | 3513 |
| 3513 } // namespace TemplateURLPrepopulateData | 3514 } // namespace TemplateURLPrepopulateData |
| OLD | NEW |