diff options
author | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 15:20:16 +0000 |
---|---|---|
committer | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 15:20:16 +0000 |
commit | 20fd79eeb79b9a0f8770a708ddcbf7f66564b57f (patch) | |
tree | 6748353019aa0dd758b5bfc820b6c1a3279f706d /chrome/browser/chromeos/input_method/input_method_delegate_impl.cc | |
parent | 002aec6aa74169469c214ec1a2b66f91678bf823 (diff) | |
download | chromium_src-20fd79eeb79b9a0f8770a708ddcbf7f66564b57f.zip chromium_src-20fd79eeb79b9a0f8770a708ddcbf7f66564b57f.tar.gz chromium_src-20fd79eeb79b9a0f8770a708ddcbf7f66564b57f.tar.bz2 |
Decouple l10n_util from InputMethodUtil.
This CL changes:
- Moving localization related function into delegate class.
- Removing GetLanguageDisplayNameFromCode and GetLanguageNativeDisplayNameFromCode from InputMethodUtil because they are just thin wrapper function of l10n_util and only used from CrosLanguageOptionHandler.
This CL does not change any test expectations except TestGetLanguageNativeDisplayNameFromCode for checking regressions.
And I'm going to refactor strings related stuff to more appropriate location.
So let me keep tests as is.
BUG=164375
TEST=ran unit_tests and also checked there is no regression with this CL on actual devices.
Review URL: https://chromiumcodereview.appspot.com/14200032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/input_method/input_method_delegate_impl.cc')
-rw-r--r-- | chrome/browser/chromeos/input_method/input_method_delegate_impl.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc b/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc index 56e1190..50a70b8 100644 --- a/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc +++ b/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc @@ -8,6 +8,7 @@ #include "base/prefs/pref_service.h" #include "chrome/browser/browser_process.h" #include "chrome/common/pref_names.h" +#include "ui/base/l10n/l10n_util.h" namespace chromeos { namespace input_method { @@ -25,12 +26,17 @@ std::string InputMethodDelegateImpl::GetHardwareKeyboardLayout() const { return std::string(); } -std::string InputMethodDelegateImpl::GetActiveLocale() const { - if (g_browser_process) - return g_browser_process->GetApplicationLocale(); +string16 InputMethodDelegateImpl::GetLocalizedString(int resource_id) const { + return l10n_util::GetStringUTF16(resource_id); +} - NOTREACHED(); - return std::string(); +string16 InputMethodDelegateImpl::GetDisplayLanguageName( + const std::string& language_code) const { + DCHECK(g_browser_process); + return l10n_util::GetDisplayNameForLocale( + language_code, + g_browser_process->GetApplicationLocale(), + true); } } // namespace input_method |