summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 19:58:18 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 19:58:18 +0000
commit9b6e452c3cefd6ae2c3cb199add3c43b20bae214 (patch)
tree7f382adc8d156068e45b9b9898bf3ae55c9cae2e /printing
parent8d1558d71bf32daa6d2f4639eea9eda0778a9705 (diff)
downloadchromium_src-9b6e452c3cefd6ae2c3cb199add3c43b20bae214.zip
chromium_src-9b6e452c3cefd6ae2c3cb199add3c43b20bae214.tar.gz
chromium_src-9b6e452c3cefd6ae2c3cb199add3c43b20bae214.tar.bz2
Change signature of |ui::ElideText()|. Add a truncate mode.
The new truncate mode is needed by my upcoming changes to rewrite CanvasSkia::DrawText(). Part of the change is changing the binary search code to a more traditional form that also makes the truncate mode work correctly. This is covered by the new unit tests. BUG=105550 TEST=New and existing tests in text_elider_unittest.cc. Review URL: http://codereview.chromium.org/8917011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114063 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/print_settings_initializer.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/printing/print_settings_initializer.cc b/printing/print_settings_initializer.cc
index 8d9065d..e82bbfc 100644
--- a/printing/print_settings_initializer.cc
+++ b/printing/print_settings_initializer.cc
@@ -47,7 +47,7 @@ void PrintSettingsInitializer::InitHeaderFooterStrings(
double segment_width = GetHeaderFooterSegmentWidth(ConvertUnitDouble(
print_settings->page_setup_device_units().physical_size().width(),
print_settings->device_units_per_inch(), kPixelsPerInch));
- date = ui::ElideText(date, font, segment_width, false);
+ date = ui::ElideText(date, font, segment_width, ui::ELIDE_AT_END);
print_settings->date = date;
// Calculate the available title width. If the date string is not long
@@ -57,7 +57,8 @@ void PrintSettingsInitializer::InitHeaderFooterStrings(
double max_title_width = std::min(2 * segment_width,
2 * (segment_width - date_width) +
segment_width);
- print_settings->title = ui::ElideText(title, font, max_title_width, false);
+ print_settings->title =
+ ui::ElideText(title, font, max_title_width, ui::ELIDE_AT_END);
double max_url_width = 2 * segment_width;
GURL gurl(url);