diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 23:00:42 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 23:00:42 +0000 |
commit | 84a761ee5394832fe52e3bba7e158d94254d3709 (patch) | |
tree | 2adb2981f3c8899c34c81b773a92e165321e623a /chrome/browser/views | |
parent | 05f0f9d02bf3c8124f68abd3446c9a981ec51913 (diff) | |
download | chromium_src-84a761ee5394832fe52e3bba7e158d94254d3709.zip chromium_src-84a761ee5394832fe52e3bba7e158d94254d3709.tar.gz chromium_src-84a761ee5394832fe52e3bba7e158d94254d3709.tar.bz2 |
Convert ElideFilename from using wstring to string16.
Some small cleanups of wstring::npos usage.
BUG=23581
Review URL: http://codereview.chromium.org/3390035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61003 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/download_item_view.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index c2f2442..1f753e9 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -596,7 +596,7 @@ void DownloadItemView::Paint(gfx::Canvas* canvas) { // Last value of x was the end of the right image, just before the button. // Note that in dangerous mode we use a label (as the text is multi-line). if (!IsDangerousMode()) { - std::wstring filename; + string16 filename; if (!disabled_while_opening_) { filename = gfx::ElideFilename(download_->GetFileName(), font_, kTextWidth); @@ -607,12 +607,12 @@ void DownloadItemView::Paint(gfx::Canvas* canvas) { l10n_util::GetStringF(IDS_DOWNLOAD_STATUS_OPENING, empty_string); int status_string_width = font_.GetStringWidth(status_string); // Then, elide the file name. - std::wstring filename_string = + string16 filename_string = gfx::ElideFilename(download_->GetFileName(), font_, kTextWidth - status_string_width); // Last, concat the whole string. - filename = l10n_util::GetStringF(IDS_DOWNLOAD_STATUS_OPENING, - filename_string); + filename = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_OPENING, + filename_string); } int mirrored_x = MirroredXWithWidthInsideView( @@ -624,7 +624,7 @@ void DownloadItemView::Paint(gfx::Canvas* canvas) { (box_height_ - font_.GetHeight()) / 2); // Draw the file's name. - canvas->DrawStringInt(filename, font_, + canvas->DrawStringInt(UTF16ToWide(filename), font_, IsEnabled() ? file_name_color : kFileNameDisabledColor, mirrored_x, y, kTextWidth, font_.GetHeight()); |