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

Unified Diff: chrome/browser/custom_home_pages_table_model.cc

Issue 6044007: Remove wstring from TableModel.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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/custom_home_pages_table_model.cc
===================================================================
--- chrome/browser/custom_home_pages_table_model.cc (revision 70272)
+++ chrome/browser/custom_home_pages_table_model.cc (working copy)
@@ -30,7 +30,7 @@
GURL url;
// Page title. If this is empty, we'll display the URL as the entry.
- std::wstring title;
+ string16 title;
// Icon for the page.
SkBitmap icon;
@@ -130,7 +130,7 @@
return static_cast<int>(entries_.size());
}
-std::wstring CustomHomePagesTableModel::GetText(int row, int column_id) {
+string16 CustomHomePagesTableModel::GetText(int row, int column_id) {
DCHECK(column_id == 0);
DCHECK(row >= 0 && row < RowCount());
return entries_[row].title.empty() ? FormattedURL(row) : entries_[row].title;
@@ -141,11 +141,10 @@
return entries_[row].icon.isNull() ? *default_favicon_ : entries_[row].icon;
}
-std::wstring CustomHomePagesTableModel::GetTooltip(int row) {
- return entries_[row].title.empty() ? std::wstring() : UTF16ToWideHack(
+string16 CustomHomePagesTableModel::GetTooltip(int row) {
+ return entries_[row].title.empty() ? string16() :
l10n_util::GetStringFUTF16(IDS_OPTIONS_STARTUP_PAGE_TOOLTIP,
- WideToUTF16Hack(entries_[row].title),
- WideToUTF16Hack(FormattedURL(row))));
+ entries_[row].title, FormattedURL(row));
}
void CustomHomePagesTableModel::SetObserver(TableModelObserver* observer) {
@@ -182,7 +181,7 @@
}
entry->title_handle = 0;
if (found_url && !row->title().empty()) {
- entry->title = UTF16ToWide(row->title());
+ entry->title = row->title();
if (observer_)
observer_->OnItemsChanged(static_cast<int>(entry_index), 1);
}
@@ -233,10 +232,10 @@
return NULL;
}
-std::wstring CustomHomePagesTableModel::FormattedURL(int row) const {
+string16 CustomHomePagesTableModel::FormattedURL(int row) const {
std::string languages =
profile_->GetPrefs()->GetString(prefs::kAcceptLanguages);
string16 url = net::FormatUrl(entries_[row].url, languages);
url = base::i18n::GetDisplayStringInLTRDirectionality(url);
- return UTF16ToWide(url);
+ return url;
}

Powered by Google App Engine
This is Rietveld 408576698