Chromium Code Reviews

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

Issue 126052: Fixes bug where keyword editor would end up prefixing all keyword urls... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/search_engines/template_url.h" 9 #include "chrome/browser/search_engines/template_url.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 3167 matching lines...)
3178 } // namespace 3178 } // namespace
3179 3179
3180 namespace TemplateURLPrepopulateData { 3180 namespace TemplateURLPrepopulateData {
3181 3181
3182 void RegisterUserPrefs(PrefService* prefs) { 3182 void RegisterUserPrefs(PrefService* prefs) {
3183 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, -1); 3183 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, -1);
3184 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown); 3184 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown);
3185 } 3185 }
3186 3186
3187 int GetDataVersion() { 3187 int GetDataVersion() {
3188 return 21; // Increment this if you change the above data in ways that mean 3188 return 22; // Increment this if you change the above data in ways that mean
3189 // users with existing data should get a new version. 3189 // users with existing data should get a new version.
3190 } 3190 }
3191 3191
3192 void GetPrepopulatedEngines(PrefService* prefs, 3192 void GetPrepopulatedEngines(PrefService* prefs,
3193 std::vector<TemplateURL*>* t_urls, 3193 std::vector<TemplateURL*>* t_urls,
3194 size_t* default_search_provider_index) { 3194 size_t* default_search_provider_index) {
3195 const PrepopulatedEngine** engines; 3195 const PrepopulatedEngine** engines;
3196 size_t num_engines; 3196 size_t num_engines;
3197 GetPrepopulationSetFromCountryID(prefs, &engines, &num_engines); 3197 GetPrepopulationSetFromCountryID(prefs, &engines, &num_engines);
3198 *default_search_provider_index = 0; 3198 *default_search_provider_index = 0;
(...skipping 15 matching lines...)
3214 new_turl->set_date_created(Time()); 3214 new_turl->set_date_created(Time());
3215 std::vector<std::string> turl_encodings; 3215 std::vector<std::string> turl_encodings;
3216 turl_encodings.push_back(engines[i]->encoding); 3216 turl_encodings.push_back(engines[i]->encoding);
3217 new_turl->set_input_encodings(turl_encodings); 3217 new_turl->set_input_encodings(turl_encodings);
3218 new_turl->set_prepopulate_id(engines[i]->id); 3218 new_turl->set_prepopulate_id(engines[i]->id);
3219 t_urls->push_back(new_turl); 3219 t_urls->push_back(new_turl);
3220 } 3220 }
3221 } 3221 }
3222 3222
3223 } // namespace TemplateURLPrepopulateData 3223 } // namespace TemplateURLPrepopulateData
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_model_unittest.cc ('k') | chrome/browser/search_engines/template_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine