Skip to content

Commit

Permalink
Enable icu_use_data_file_flag on CrOS
Browse files Browse the repository at this point in the history
1. Enable icu_use_data_file_flag on CrOS

2. Doing #1 led to a crash because GetStringUTF8 (that relies on ICU to determine whether the current UI language is RTL) is called before InitializeICU is called. Instead of using GetStringUTF8, get the string directly from the resource bundle because there's no need to adjust the string for the RTL locale in this particular case. 

Note to perf-sheriff : The size of chrome binary will be 10M smaller because the ICU data is now in a separate file (icudtl.dat) whose size is about 10M. 

BUG=72633
TEST=ui_base_unittests

Review URL: https://codereview.chromium.org/135963010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248325 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
[email protected] committed Feb 1, 2014
1 parent 4189ec4 commit 54e644a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ deps_os = {
# Build tools for targeting ChromeOS.
"src/third_party/chromite":
Var("chromiumos_git") + "/chromite.git" +
"@6637dcd35a8b9f02ba54d2a369118306cee88432",
"@1ee2901d33ae698d1f2a1d95e9f3fd5bbd5f13f9",

# Dependency of chromite.git.
"src/third_party/pyelftools":
Expand Down
4 changes: 2 additions & 2 deletions build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,8 @@
# can use breakpad for these builds.
'release_unwind_tables%': 0,
}],
# TODO(jungshik): Turn this on on Android and CrOS as well.
['OS!="android" and chromeos==0', {
# TODO(jungshik): Turn this on on Android.
['OS!="android"', {
'icu_use_data_file_flag%': 1,
}],
],
Expand Down
9 changes: 5 additions & 4 deletions ui/base/resource/resource_bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ ResourceBundle* g_shared_instance_ = NULL;

void InitDefaultFontList() {
#if defined(OS_CHROMEOS)
gfx::FontList::SetDefaultFontDescription(
l10n_util::GetStringUTF8(IDS_UI_FONT_FAMILY_CROS));
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
std::string font_family = base::UTF16ToUTF8(
rb.GetLocalizedString(IDS_UI_FONT_FAMILY_CROS));
gfx::FontList::SetDefaultFontDescription(font_family);

// TODO(yukishiino): Remove SetDefaultFontDescription() once the migration to
// the font list is done. We will no longer need SetDefaultFontDescription()
// after every client gets started using a FontList instead of a Font.
gfx::PlatformFontPango::SetDefaultFontDescription(
l10n_util::GetStringUTF8(IDS_UI_FONT_FAMILY_CROS));
gfx::PlatformFontPango::SetDefaultFontDescription(font_family);
#else
// Use a single default font as the default font list.
gfx::FontList::SetDefaultFontDescription(std::string());
Expand Down

0 comments on commit 54e644a

Please sign in to comment.