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

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

Issue 7232023: Added last_modified field to TemplateURL and database. Updated unit tests, including refactoring ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 3376 matching lines...) Expand 10 before | Expand all | Expand 10 after
3387 if (instant_url) 3387 if (instant_url)
3388 new_turl->SetInstantURL(WideToUTF8(instant_url), 0, 0); 3388 new_turl->SetInstantURL(WideToUTF8(instant_url), 0, 0);
3389 new_turl->set_short_name(WideToUTF16Hack(name)); 3389 new_turl->set_short_name(WideToUTF16Hack(name));
3390 if (keyword == NULL) 3390 if (keyword == NULL)
3391 new_turl->set_autogenerate_keyword(true); 3391 new_turl->set_autogenerate_keyword(true);
3392 else 3392 else
3393 new_turl->set_keyword(WideToUTF16Hack(keyword)); 3393 new_turl->set_keyword(WideToUTF16Hack(keyword));
3394 new_turl->set_show_in_default_list(true); 3394 new_turl->set_show_in_default_list(true);
3395 new_turl->set_safe_for_autoreplace(true); 3395 new_turl->set_safe_for_autoreplace(true);
3396 new_turl->set_date_created(Time()); 3396 new_turl->set_date_created(Time());
3397 new_turl->set_last_modified(Time());
3397 std::vector<std::string> turl_encodings; 3398 std::vector<std::string> turl_encodings;
3398 turl_encodings.push_back(encoding); 3399 turl_encodings.push_back(encoding);
3399 new_turl->set_input_encodings(turl_encodings); 3400 new_turl->set_input_encodings(turl_encodings);
3400 new_turl->set_search_engine_type(search_engine_type); 3401 new_turl->set_search_engine_type(search_engine_type);
3401 new_turl->set_logo_id(logo_id); 3402 new_turl->set_logo_id(logo_id);
3402 new_turl->set_prepopulate_id(id); 3403 new_turl->set_prepopulate_id(id);
3403 return new_turl; 3404 return new_turl;
3404 } 3405 }
3405 3406
3406 void GetPrepopulatedTemplateFromPrefs(PrefService* prefs, 3407 void GetPrepopulatedTemplateFromPrefs(PrefService* prefs,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
3572 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { 3573 for (size_t i = 0; i < arraysize(kAllEngines); ++i) {
3573 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); 3574 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url));
3574 GURL url(url_utf8_string); 3575 GURL url(url_utf8_string);
3575 if (origin_to_find == url.GetOrigin()) 3576 if (origin_to_find == url.GetOrigin())
3576 return kAllEngines[i]->logo_id; 3577 return kAllEngines[i]->logo_id;
3577 } 3578 }
3578 return kNoSearchEngineLogo; 3579 return kNoSearchEngineLogo;
3579 } 3580 }
3580 3581
3581 } // namespace TemplateURLPrepopulateData 3582 } // namespace TemplateURLPrepopulateData
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url.cc ('k') | chrome/browser/search_engines/template_url_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698