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

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

Issue 10353017: Unlaunch the HIDDEN mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed @sky's comment; fixed tests 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 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 SEARCH_ENGINE_GOO, 1082 SEARCH_ENGINE_GOO,
1083 23, 1083 23,
1084 }; 1084 };
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 "sourceid=chrome&ie={inputEncoding}&q={searchTerms}",
1093 "ie={inputEncoding}&q={searchTerms}",
1094 "UTF-8", 1093 "UTF-8",
1095 "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}" 1094 "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}"
1096 "{google:instantFieldTrialGroupParameter}client=chrome&hl={language}&" 1095 "client=chrome&hl={language}&q={searchTerms}",
1097 "q={searchTerms}",
1098 "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&" 1096 "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&"
1099 "{google:instantFieldTrialGroupParameter}ie={inputEncoding}" 1097 "ie={inputEncoding}{google:instantEnabledParameter}{searchTerms}",
1100 "{google:instantEnabledParameter}{searchTerms}",
1101 SEARCH_ENGINE_GOOGLE, 1098 SEARCH_ENGINE_GOOGLE,
1102 1, 1099 1,
1103 }; 1100 };
1104 1101
1105 const PrepopulatedEngine guruji = { 1102 const PrepopulatedEngine guruji = {
1106 L"guruji", 1103 L"guruji",
1107 L"guruji.com", 1104 L"guruji.com",
1108 "http://guruji.com/favicon.ico", 1105 "http://guruji.com/favicon.ico",
1109 "http://guruji.com/search?q={searchTerms}", 1106 "http://guruji.com/search?q={searchTerms}",
1110 "UTF-8", 1107 "UTF-8",
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 PrefService::UNSYNCABLE_PREF); 3130 PrefService::UNSYNCABLE_PREF);
3134 // Obsolete pref, for migration. 3131 // Obsolete pref, for migration.
3135 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, 3132 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall,
3136 -1, 3133 -1,
3137 PrefService::UNSYNCABLE_PREF); 3134 PrefService::UNSYNCABLE_PREF);
3138 } 3135 }
3139 3136
3140 int GetDataVersion(PrefService* prefs) { 3137 int GetDataVersion(PrefService* prefs) {
3141 // Increment this if you change the above data in ways that mean users with 3138 // Increment this if you change the above data in ways that mean users with
3142 // existing data should get a new version. 3139 // existing data should get a new version.
3143 const int kCurrentDataVersion = 38; 3140 const int kCurrentDataVersion = 39;
3144 if (!prefs) 3141 if (!prefs)
3145 return kCurrentDataVersion; 3142 return kCurrentDataVersion;
3146 // If a version number exist in the preferences file, it overrides the 3143 // If a version number exist in the preferences file, it overrides the
3147 // version of the built-in data. 3144 // version of the built-in data.
3148 int version = 3145 int version =
3149 prefs->GetInteger(prefs::kSearchProviderOverridesVersion); 3146 prefs->GetInteger(prefs::kSearchProviderOverridesVersion);
3150 return (version >= 0) ? version : kCurrentDataVersion; 3147 return (version >= 0) ? version : kCurrentDataVersion;
3151 } 3148 }
3152 3149
3153 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, 3150 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
3308 UTF8ToUTF16(as_gurl.host()) : 3305 UTF8ToUTF16(as_gurl.host()) :
3309 l10n_util::GetStringUTF16(IDS_UNKNOWN_SEARCH_ENGINE_NAME); 3306 l10n_util::GetStringUTF16(IDS_UNKNOWN_SEARCH_ENGINE_NAME);
3310 } 3307 }
3311 3308
3312 SearchEngineType GetEngineType(const std::string& url) { 3309 SearchEngineType GetEngineType(const std::string& url) {
3313 const PrepopulatedEngine* engine = GetEngineForURL(url); 3310 const PrepopulatedEngine* engine = GetEngineForURL(url);
3314 return engine ? engine->type : SEARCH_ENGINE_OTHER; 3311 return engine ? engine->type : SEARCH_ENGINE_OTHER;
3315 } 3312 }
3316 3313
3317 } // namespace TemplateURLPrepopulateData 3314 } // namespace TemplateURLPrepopulateData
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url.cc ('k') | chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698