summaryrefslogtreecommitdiffstats
path: root/chrome/browser/language_combobox_model.cc
diff options
context:
space:
mode:
authorglotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-09 19:08:43 +0000
committerglotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-09 19:08:43 +0000
commit890c4efad2204283b8694e6b841c15375ad1390b (patch)
tree8386a2a0291f616e6f0bef6ac141a0de3b062d94 /chrome/browser/language_combobox_model.cc
parentc1786301d064a8f1d26fab2393e176d9f3464822 (diff)
downloadchromium_src-890c4efad2204283b8694e6b841c15375ad1390b.zip
chromium_src-890c4efad2204283b8694e6b841c15375ad1390b.tar.gz
chromium_src-890c4efad2204283b8694e6b841c15375ad1390b.tar.bz2
Language selection menu rearranged to main menu with main languages and sub-menu with all others.
BUG=35248 TEST=Switch the language used by the ChromiumOS using the top left corner menu of the Network selection wizard. Or you may use the following command on desktop using Chromium (built with GYP_DEFINES="chromeos=1"): out/Debug/chrome --login-manager --login-name=nework Review URL: http://codereview.chromium.org/732001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/language_combobox_model.cc')
-rw-r--r--chrome/browser/language_combobox_model.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/language_combobox_model.cc b/chrome/browser/language_combobox_model.cc
index 03d31a5..95d9598 100644
--- a/chrome/browser/language_combobox_model.cc
+++ b/chrome/browser/language_combobox_model.cc
@@ -54,6 +54,17 @@ void LanguageList::InitNativeNames(
&locale_names_);
}
+void LanguageList::CopySpecifiedLanguagesUp(const std::string& locale_codes) {
+ DCHECK(!locale_names_.empty());
+ std::vector<std::string> locale_codes_vector;
+ SplitString(locale_codes, ',', &locale_codes_vector);
+ for (size_t i = 0; i != locale_codes_vector.size(); i++) {
+ const int locale_index = GetIndexFromLocale(locale_codes_vector[i]);
+ CHECK_NE(locale_index, -1);
+ locale_names_.insert(locale_names_.begin(), locale_names_[locale_index]);
+ }
+}
+
// Overridden from ComboboxModel:
int LanguageList::get_languages_count() const {
return static_cast<int>(locale_names_.size());