diff options
author | cramya@chromium.org <cramya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 23:19:46 +0000 |
---|---|---|
committer | cramya@chromium.org <cramya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 23:19:46 +0000 |
commit | 6e27ac7389dd5d6220900673bb5b7db982877f87 (patch) | |
tree | 7a011d4e350a80cfdd1ceeb43890401554b7427e | |
parent | 3f7a0c2b547db3cea609686c6773922d877f0f51 (diff) | |
download | chromium_src-6e27ac7389dd5d6220900673bb5b7db982877f87.zip chromium_src-6e27ac7389dd5d6220900673bb5b7db982877f87.tar.gz chromium_src-6e27ac7389dd5d6220900673bb5b7db982877f87.tar.bz2 |
Android implementation for localized search engines
Update the CurrentCountryID to be used for localized
search engines
TEST=none
BUG=none
Review URL: https://chromiumcodereview.appspot.com/10454014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142264 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/search_engines/template_url_prepopulate_data.cc | 7 | ||||
-rw-r--r-- | chrome/browser/search_engines/template_url_prepopulate_data.h | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc index 425e110..7eccfdb 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data.cc +++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc @@ -2829,8 +2829,11 @@ int GetCurrentCountryID() { #elif defined(OS_ANDROID) int GetCurrentCountryID() { - NOTIMPLEMENTED(); - return kCountryIDUnknown; + const std::string country_code_at_install = + TemplateURLPrepopulateData::GetCountryCodeAtInstall(); + return country_code_at_install.empty() ? kCountryIDUnknown : + CountryCharsToCountryIDWithUpdate(country_code_at_install[0], + country_code_at_install[1]); } #elif defined(OS_POSIX) diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.h b/chrome/browser/search_engines/template_url_prepopulate_data.h index fa75caa..1b96fd7 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data.h +++ b/chrome/browser/search_engines/template_url_prepopulate_data.h @@ -22,6 +22,13 @@ namespace TemplateURLPrepopulateData { extern const int kMaxPrepopulatedEngineID; +#if defined(OS_ANDROID) +// Returns the default country code at the time of install from Android. +// This could either be the command line value that has been set or the +// current location code during install. +extern const std::string GetCountryCodeAtInstall(); +#endif + void RegisterUserPrefs(PrefService* prefs); // Returns the current version of the prepopulate data, so callers can know when |