summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run_win.cc
diff options
context:
space:
mode:
authormirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 00:35:01 +0000
committermirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 00:35:01 +0000
commit15406b6ab2f2c701d6e82c8e53c22d1c570c739a (patch)
tree3ec5bf3f1ca12625e4dff0f5579b7f3ad787248b /chrome/browser/first_run_win.cc
parentff62185663f68c9d40dc13dec778ca0e321afdf9 (diff)
downloadchromium_src-15406b6ab2f2c701d6e82c8e53c22d1c570c739a.zip
chromium_src-15406b6ab2f2c701d6e82c8e53c22d1c570c739a.tar.gz
chromium_src-15406b6ab2f2c701d6e82c8e53c22d1c570c739a.tar.bz2
Check for proper locale before recording search engine data, or offering the search engine experimental dialog.
BUG= 37564 TEST= none Review URL: http://codereview.chromium.org/1709003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run_win.cc')
-rw-r--r--chrome/browser/first_run_win.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc
index 086a2c4..cc34dc1 100644
--- a/chrome/browser/first_run_win.cc
+++ b/chrome/browser/first_run_win.cc
@@ -8,6 +8,7 @@
#include <shellapi.h>
#include <shlobj.h>
+#include <set>
#include <sstream>
// TODO(port): trim this include list once first run has been refactored fully.
@@ -320,7 +321,8 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
}
}
- if (installer_util::GetDistroBooleanPreference(prefs.get(),
+ if (InSearchExperimentLocale() &&
+ installer_util::GetDistroBooleanPreference(prefs.get(),
installer_util::master_preferences::kSearchEngineExperimentPref,
&value) && value) {
// Set the first run dialog to include the search choice window.
@@ -729,6 +731,19 @@ int FirstRun::ImportFromBrowser(Profile* profile,
return observer.import_result();
}
+// static
+bool FirstRun::InSearchExperimentLocale() {
+ static std::set<std::string> allowed_locales;
+ if (allowed_locales.empty()) {
+ // List of locales in which search experiment can be run.
+ allowed_locales.insert("en-GB");
+ allowed_locales.insert("en-US");
+ }
+ const std::string app_locale = g_browser_process->GetApplicationLocale();
+ std::set<std::string>::iterator locale = allowed_locales.find(app_locale);
+ return locale != allowed_locales.end();
+}
+
//////////////////////////////////////////////////////////////////////////
namespace {