Chromium Code Reviews| 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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1083 NULL, | 1083 NULL, |
| 1084 SEARCH_ENGINE_GOO, | 1084 SEARCH_ENGINE_GOO, |
| 1085 23, | 1085 23, |
| 1086 }; | 1086 }; |
| 1087 | 1087 |
| 1088 const PrepopulatedEngine google = { | 1088 const PrepopulatedEngine google = { |
| 1089 L"Google", | 1089 L"Google", |
| 1090 L"google.com", // This will be dynamically updated by the TemplateURL system. | 1090 L"google.com", // This will be dynamically updated by the TemplateURL system. |
| 1091 "http://www.google.com/favicon.ico", | 1091 "http://www.google.com/favicon.ico", |
| 1092 "{google:baseURL}search?q={searchTerms}&{google:RLZ}" | 1092 "{google:baseURL}search?q={searchTerms}&{google:RLZ}" |
| 1093 "{google:acceptedSuggestion}{google:originalQueryForSuggestion}" | 1093 "{google:acceptedSuggestion}{google:originalQueryForSuggestion}" |
|
Peter Kasting
2012/06/14 01:04:23
Why do we still have acceptedSuggestion and origin
Bart N
2012/06/15 18:07:34
As discussed, we need OQ, and we will keep AQ unti
| |
| 1094 "{google:assistedQueryStats}" | |
| 1094 "{google:searchFieldtrialParameter}sourceid=chrome&ie={inputEncoding}", | 1095 "{google:searchFieldtrialParameter}sourceid=chrome&ie={inputEncoding}", |
| 1095 "UTF-8", | 1096 "UTF-8", |
| 1096 "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}" | 1097 "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}" |
| 1097 "client=chrome&hl={language}&q={searchTerms}", | 1098 "client=chrome&hl={language}&q={searchTerms}", |
| 1098 "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&" | 1099 "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&" |
| 1099 "ie={inputEncoding}{google:instantEnabledParameter}{searchTerms}", | 1100 "ie={inputEncoding}{google:instantEnabledParameter}{searchTerms}", |
| 1100 SEARCH_ENGINE_GOOGLE, | 1101 SEARCH_ENGINE_GOOGLE, |
| 1101 1, | 1102 1, |
| 1102 }; | 1103 }; |
| 1103 | 1104 |
| (...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3274 PrefService::UNSYNCABLE_PREF); | 3275 PrefService::UNSYNCABLE_PREF); |
| 3275 // Obsolete pref, for migration. | 3276 // Obsolete pref, for migration. |
| 3276 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, | 3277 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, |
| 3277 -1, | 3278 -1, |
| 3278 PrefService::UNSYNCABLE_PREF); | 3279 PrefService::UNSYNCABLE_PREF); |
| 3279 } | 3280 } |
| 3280 | 3281 |
| 3281 int GetDataVersion(PrefService* prefs) { | 3282 int GetDataVersion(PrefService* prefs) { |
| 3282 // Increment this if you change the above data in ways that mean users with | 3283 // Increment this if you change the above data in ways that mean users with |
| 3283 // existing data should get a new version. | 3284 // existing data should get a new version. |
| 3284 const int kCurrentDataVersion = 39; | 3285 const int kCurrentDataVersion = 40; |
| 3285 // Allow tests to override the local version. | 3286 // Allow tests to override the local version. |
| 3286 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? | 3287 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? |
| 3287 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : | 3288 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : |
| 3288 kCurrentDataVersion; | 3289 kCurrentDataVersion; |
| 3289 } | 3290 } |
| 3290 | 3291 |
| 3291 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, | 3292 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, |
| 3292 const string16& name, | 3293 const string16& name, |
| 3293 const string16& keyword, | 3294 const string16& keyword, |
| 3294 const base::StringPiece& search_url, | 3295 const base::StringPiece& search_url, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3435 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { | 3436 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { |
| 3436 GURL engine_url(kAllEngines[i]->search_url); | 3437 GURL engine_url(kAllEngines[i]->search_url); |
| 3437 if (engine_url.is_valid() && (origin == engine_url.GetOrigin())) | 3438 if (engine_url.is_valid() && (origin == engine_url.GetOrigin())) |
| 3438 return kAllEngines[i]->type; | 3439 return kAllEngines[i]->type; |
| 3439 } | 3440 } |
| 3440 | 3441 |
| 3441 return SEARCH_ENGINE_OTHER; | 3442 return SEARCH_ENGINE_OTHER; |
| 3442 } | 3443 } |
| 3443 | 3444 |
| 3444 } // namespace TemplateURLPrepopulateData | 3445 } // namespace TemplateURLPrepopulateData |
| OLD | NEW |