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

Side by Side Diff: chrome/browser/views/options/language_combobox_model.cc

Issue 126223: Replace std:;wstring with std::string in locale-name related APIs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/options/language_combobox_model.h" 5 #include "chrome/browser/views/options/language_combobox_model.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/metrics/user_metrics.h" 10 #include "chrome/browser/metrics/user_metrics.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 LanguageComboboxModel::LanguageComboboxModel( 28 LanguageComboboxModel::LanguageComboboxModel(
29 Profile* profile, const std::vector<std::string>& locale_codes) 29 Profile* profile, const std::vector<std::string>& locale_codes)
30 : profile_(profile) { 30 : profile_(profile) {
31 InitNativeNames(locale_codes); 31 InitNativeNames(locale_codes);
32 } 32 }
33 33
34 void LanguageComboboxModel::InitNativeNames( 34 void LanguageComboboxModel::InitNativeNames(
35 const std::vector<std::string>& locale_codes) { 35 const std::vector<std::string>& locale_codes) {
36 const std::string app_locale = WideToASCII( 36 const std::string app_locale = g_browser_process->GetApplicationLocale();
37 g_browser_process->GetApplicationLocale());
38 for (size_t i = 0; i < locale_codes.size(); ++i) { 37 for (size_t i = 0; i < locale_codes.size(); ++i) {
39 std::string locale_code_str = locale_codes[i]; 38 std::string locale_code_str = locale_codes[i];
40 const char* locale_code = locale_codes[i].c_str(); 39 const char* locale_code = locale_codes[i].c_str();
41 40
42 // Internally, we use the language code of zh-CN and zh-TW, but we want the 41 // Internally, we use the language code of zh-CN and zh-TW, but we want the
43 // display names to be Chinese (Simplified) and Chinese (Traditional). To 42 // display names to be Chinese (Simplified) and Chinese (Traditional). To
44 // do that, we use zh-hans and zh-hant when using ICU's 43 // do that, we use zh-hans and zh-hant when using ICU's
45 // uloc_getDisplayName. 44 // uloc_getDisplayName.
46 if (locale_code_str == "zh-CN") { 45 if (locale_code_str == "zh-CN") {
47 locale_code = "zh-hans"; 46 locale_code = "zh-hans";
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 local_state = g_browser_process->local_state(); 155 local_state = g_browser_process->local_state();
157 else 156 else
158 local_state = profile_->GetPrefs(); 157 local_state = profile_->GetPrefs();
159 158
160 DCHECK(local_state); 159 DCHECK(local_state);
161 const std::string& current_locale = 160 const std::string& current_locale =
162 WideToASCII(local_state->GetString(prefs.c_str())); 161 WideToASCII(local_state->GetString(prefs.c_str()));
163 162
164 return GetIndexFromLocale(current_locale); 163 return GetIndexFromLocale(current_locale);
165 } 164 }
OLDNEW
« no previous file with comments | « chrome/browser/views/options/fonts_page_view.cc ('k') | chrome/browser/views/options/languages_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698