Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Unified Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 8113031: Change std::wstring to string16 for views::Label and views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 33951dde0fec51eb25b84c98628f100b4b1c96aa..6ca864e697e872d352f2724fe7a0abd7d25dacac 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/download/download_item_view.h"
+#include <algorithm>
#include <vector>
#include "base/callback.h"
@@ -276,7 +277,7 @@ DownloadItemView::DownloadItemView(DownloadItem* download,
}
}
- dangerous_download_label_ = new views::Label(UTF16ToWide(dangerous_label));
+ dangerous_download_label_ = new views::Label(dangerous_label);
dangerous_download_label_->SetMultiLine(true);
dangerous_download_label_->SetHorizontalAlignment(
views::Label::ALIGN_LEFT);
@@ -1034,7 +1035,7 @@ void DownloadItemView::SizeLabelToMinWidth() {
if (dangerous_download_label_sized_)
return;
- string16 text = WideToUTF16(dangerous_download_label_->GetText());
+ string16 text = dangerous_download_label_->GetText();
TrimWhitespace(text, TRIM_ALL, &text);
DCHECK_EQ(string16::npos, text.find('\n'));
@@ -1065,7 +1066,7 @@ void DownloadItemView::SizeLabelToMinWidth() {
current_text.replace(pos - 1, 1, 1, char16('\n'));
else
current_text.insert(pos, 1, char16('\n'));
- dangerous_download_label_->SetText(UTF16ToWide(current_text));
+ dangerous_download_label_->SetText(current_text);
size = dangerous_download_label_->GetPreferredSize();
if (min_width == -1)
@@ -1073,7 +1074,7 @@ void DownloadItemView::SizeLabelToMinWidth() {
// If the width is growing again, it means we passed the optimal width spot.
if (size.width() > min_width) {
- dangerous_download_label_->SetText(UTF16ToWide(prev_text));
+ dangerous_download_label_->SetText(prev_text);
break;
} else {
min_width = size.width();
@@ -1107,7 +1108,7 @@ bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) {
void DownloadItemView::UpdateAccessibleName() {
string16 new_name;
if (download_->safety_state() == DownloadItem::DANGEROUS) {
- new_name = WideToUTF16Hack(dangerous_download_label_->GetText());
+ new_name = dangerous_download_label_->GetText();
} else {
new_name = status_text_ + char16(' ') +
download_->GetFileNameToReportUser().LossyDisplayName();

Powered by Google App Engine
This is Rietveld 408576698