summaryrefslogtreecommitdiffstats
path: root/chrome/common/l10n_util.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-02 00:56:57 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-02 00:56:57 +0000
commit4b68e0d50c4a69b91a384b698a96f6a51ca7241f (patch)
treea11dc1b6baf8d2e1d1c3d8b7930fb9ca0cec46eb /chrome/common/l10n_util.cc
parent82d10b14f9b4150ce1e154629dec9dcddadcf272 (diff)
downloadchromium_src-4b68e0d50c4a69b91a384b698a96f6a51ca7241f.zip
chromium_src-4b68e0d50c4a69b91a384b698a96f6a51ca7241f.tar.gz
chromium_src-4b68e0d50c4a69b91a384b698a96f6a51ca7241f.tar.bz2
Yet more deprecation of the wstring version of PathService::Get() for UI tests.
Review URL: http://codereview.chromium.org/99298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15127 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/l10n_util.cc')
-rw-r--r--chrome/common/l10n_util.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/common/l10n_util.cc b/chrome/common/l10n_util.cc
index 2b47e5f..1039a1d 100644
--- a/chrome/common/l10n_util.cc
+++ b/chrome/common/l10n_util.cc
@@ -7,7 +7,6 @@
#include "chrome/common/l10n_util.h"
#include "base/command_line.h"
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
@@ -229,7 +228,7 @@ std::wstring GetApplicationLocale(const std::wstring& pref_locale) {
// TODO(pinkerton): break this out into a .mm and ask Cocoa.
return L"en";
#else
- std::wstring locale_path;
+ FilePath locale_path;
PathService::Get(chrome::DIR_LOCALES, &locale_path);
std::wstring resolved_locale;
@@ -238,24 +237,27 @@ std::wstring GetApplicationLocale(const std::wstring& pref_locale) {
const std::wstring& lang_arg =
parsed_command_line.GetSwitchValue(switches::kLang);
if (!lang_arg.empty()) {
- if (CheckAndResolveLocale(lang_arg, locale_path, &resolved_locale))
+ if (CheckAndResolveLocale(lang_arg, locale_path.ToWStringHack(),
+ &resolved_locale))
return resolved_locale;
}
// Second, try user prefs.
if (!pref_locale.empty()) {
- if (CheckAndResolveLocale(pref_locale, locale_path, &resolved_locale))
+ if (CheckAndResolveLocale(pref_locale, locale_path.ToWStringHack(),
+ &resolved_locale))
return resolved_locale;
}
// Next, try the system locale.
const std::wstring system_locale = GetSystemLocale();
- if (CheckAndResolveLocale(system_locale, locale_path, &resolved_locale))
+ if (CheckAndResolveLocale(system_locale, locale_path.ToWStringHack(),
+ &resolved_locale))
return resolved_locale;
// Fallback on en-US.
const std::wstring fallback_locale(L"en-US");
- if (IsLocaleAvailable(fallback_locale, locale_path))
+ if (IsLocaleAvailable(fallback_locale, locale_path.ToWStringHack()))
return fallback_locale;
// No locale data file was found; we shouldn't get here.
@@ -479,7 +481,7 @@ TextDirection GetTextDirection() {
}
TextDirection GetTextDirectionForLocale(const char* locale_name) {
- UScriptCode scripts[10]; // 10 scripts should be enough for any locale.
+ UScriptCode scripts[10]; // 10 scripts should be enough for any locale.
UErrorCode error = U_ZERO_ERROR;
int n = uscript_getCode(locale_name, scripts, 10, &error);
DCHECK(U_SUCCESS(error) && n > 0);