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

Unified Diff: chrome/browser/search_engines/template_url_prepopulate_data.cc

Issue 11348135: Fix TemplateURLFetcherTest.* for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gtest_filter/unit_tests_disabled ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_prepopulate_data.cc
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc
index 71eaa3d67a7659143020b83fe776ef40b010ccb3..9e9e27937c84d79df68a3f54c66ed18a2d9e1f55 100644
--- a/chrome/browser/search_engines/template_url_prepopulate_data.cc
+++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc
@@ -526,7 +526,6 @@ const PrepopulatedEngine* kAllEngines[] =
// value we call the CountryID.
const int kCountryIDUnknown = -1;
-const int kCountryIDNotSet = 0;
inline int CountryCharsToCountryID(char c1, char c2) {
return c1 << 8 | c2;
@@ -635,13 +634,22 @@ int GetCurrentCountryID() {
#elif defined(OS_ANDROID)
// Initialized by InitCountryCode().
-int g_country_code_at_install = kCountryIDNotSet;
+int g_country_code_at_install = kCountryIDUnknown;
int GetCurrentCountryID() {
- DCHECK(g_country_code_at_install != kCountryIDNotSet);
return g_country_code_at_install;
}
+void InitCountryCode(const std::string& country_code) {
+ if (country_code.size() != 2) {
+ DLOG(ERROR) << "Invalid country code: " << country_code;
+ g_country_code_at_install = kCountryIDUnknown;
+ } else {
+ g_country_code_at_install =
+ CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]);
+ }
+}
+
#elif defined(OS_POSIX)
int GetCurrentCountryID() {
@@ -1279,18 +1287,4 @@ GURL GetLogoURL(const TemplateURL& template_url, LogoSize size) {
return GURL();
}
-#if defined(OS_ANDROID)
-
-void InitCountryCode(const std::string& country_code) {
- if (country_code.size() != 2) {
- DLOG(ERROR) << "Invalid country code: " << country_code;
- g_country_code_at_install = kCountryIDUnknown;
- } else {
- g_country_code_at_install =
- CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]);
- }
-}
-
-#endif
-
} // namespace TemplateURLPrepopulateData
« no previous file with comments | « build/android/gtest_filter/unit_tests_disabled ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698