OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/language_combobox_model.h" | 5 #include "chrome/browser/language_combobox_model.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/metrics/user_metrics.h" | 13 #include "chrome/browser/metrics/user_metrics.h" |
14 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
15 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 #include "unicode/uloc.h" | 17 #include "unicode/uloc.h" |
18 | 18 |
19 /////////////////////////////////////////////////////////////////////////////// | 19 /////////////////////////////////////////////////////////////////////////////// |
20 // LanguageList used to enumerate native names corresponding to the | 20 // LanguageList used to enumerate native names corresponding to the |
21 // language code (e.g. English (United States) for en-US) | 21 // language code (e.g. English (United States) for en-US) |
22 // | 22 // |
23 | 23 |
24 LanguageList::LanguageList() { | 24 LanguageList::LanguageList() { |
25 // Enumerate the languages we know about. | 25 // Enumerate the languages we know about. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 if (!profile_) | 167 if (!profile_) |
168 local_state = g_browser_process->local_state(); | 168 local_state = g_browser_process->local_state(); |
169 else | 169 else |
170 local_state = profile_->GetPrefs(); | 170 local_state = profile_->GetPrefs(); |
171 | 171 |
172 DCHECK(local_state); | 172 DCHECK(local_state); |
173 const std::string& current_locale = local_state->GetString(prefs.c_str()); | 173 const std::string& current_locale = local_state->GetString(prefs.c_str()); |
174 | 174 |
175 return GetIndexFromLocale(current_locale); | 175 return GetIndexFromLocale(current_locale); |
176 } | 176 } |
OLD | NEW |