Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: chrome/browser/search_engines/template_url_prepopulate_data.cc

Issue 10274023: Omnibox SearchProvider Experiment Client Implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Working to some degree... Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 1085
1086 const PrepopulatedEngine google = { 1086 const PrepopulatedEngine google = {
1087 L"Google", 1087 L"Google",
1088 L"", 1088 L"",
1089 "http://www.google.com/favicon.ico", 1089 "http://www.google.com/favicon.ico",
1090 "{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}" 1090 "{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}"
1091 "{google:originalQueryForSuggestion}{google:searchFieldtrialParameter}" 1091 "{google:originalQueryForSuggestion}{google:searchFieldtrialParameter}"
1092 "{google:instantFieldTrialGroupParameter}sourceid=chrome&" 1092 "{google:instantFieldTrialGroupParameter}sourceid=chrome&"
1093 "ie={inputEncoding}&q={searchTerms}", 1093 "ie={inputEncoding}&q={searchTerms}",
1094 "UTF-8", 1094 "UTF-8",
1095 "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}" 1095 // Testing the suggest experiment provider...
Peter Kasting 2012/05/04 00:11:33 Make sure you don't check this in :)
msw 2012/05/04 09:43:40 Done.
1096 "{google:instantFieldTrialGroupParameter}client=chrome&hl={language}&" 1096 "http://0.websearch-nonprod.gws.hfung.vd.borg.google.com/complete/search?q={se archTerms}&client=chrome",
1097 "q={searchTerms}", 1097 //"{google:baseSuggestURL}search?{google:searchFieldtrialParameter}"
1098 // "{google:instantFieldTrialGroupParameter}client=chrome&hl={language}&"
1099 // "q={searchTerms}",
1098 "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&" 1100 "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&"
1099 "{google:instantFieldTrialGroupParameter}ie={inputEncoding}" 1101 "{google:instantFieldTrialGroupParameter}ie={inputEncoding}"
1100 "{google:instantEnabledParameter}{searchTerms}", 1102 "{google:instantEnabledParameter}{searchTerms}",
1101 SEARCH_ENGINE_GOOGLE, 1103 SEARCH_ENGINE_GOOGLE,
1102 1, 1104 1,
1103 }; 1105 };
1104 1106
1105 const PrepopulatedEngine guruji = { 1107 const PrepopulatedEngine guruji = {
1106 L"guruji", 1108 L"guruji",
1107 L"guruji.com", 1109 L"guruji.com",
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 PrefService::UNSYNCABLE_PREF); 3135 PrefService::UNSYNCABLE_PREF);
3134 // Obsolete pref, for migration. 3136 // Obsolete pref, for migration.
3135 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, 3137 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall,
3136 -1, 3138 -1,
3137 PrefService::UNSYNCABLE_PREF); 3139 PrefService::UNSYNCABLE_PREF);
3138 } 3140 }
3139 3141
3140 int GetDataVersion(PrefService* prefs) { 3142 int GetDataVersion(PrefService* prefs) {
3141 // Increment this if you change the above data in ways that mean users with 3143 // Increment this if you change the above data in ways that mean users with
3142 // existing data should get a new version. 3144 // existing data should get a new version.
3143 const int kCurrentDataVersion = 38; 3145 const int kCurrentDataVersion = 39;
3144 if (!prefs) 3146 if (!prefs)
3145 return kCurrentDataVersion; 3147 return kCurrentDataVersion;
3146 // If a version number exist in the preferences file, it overrides the 3148 // If a version number exist in the preferences file, it overrides the
3147 // version of the built-in data. 3149 // version of the built-in data.
3148 int version = 3150 int version =
3149 prefs->GetInteger(prefs::kSearchProviderOverridesVersion); 3151 prefs->GetInteger(prefs::kSearchProviderOverridesVersion);
3150 return (version >= 0) ? version : kCurrentDataVersion; 3152 return (version >= 0) ? version : kCurrentDataVersion;
3151 } 3153 }
3152 3154
3153 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, 3155 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
3307 UTF8ToUTF16(as_gurl.host()) : 3309 UTF8ToUTF16(as_gurl.host()) :
3308 l10n_util::GetStringUTF16(IDS_UNKNOWN_SEARCH_ENGINE_NAME); 3310 l10n_util::GetStringUTF16(IDS_UNKNOWN_SEARCH_ENGINE_NAME);
3309 } 3311 }
3310 3312
3311 SearchEngineType GetEngineType(const std::string& url) { 3313 SearchEngineType GetEngineType(const std::string& url) {
3312 const PrepopulatedEngine* engine = GetEngineForURL(url); 3314 const PrepopulatedEngine* engine = GetEngineForURL(url);
3313 return engine ? engine->type : SEARCH_ENGINE_OTHER; 3315 return engine ? engine->type : SEARCH_ENGINE_OTHER;
3314 } 3316 }
3315 3317
3316 } // namespace TemplateURLPrepopulateData 3318 } // namespace TemplateURLPrepopulateData
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698