summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 00:50:04 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 00:50:04 +0000
commitbdaab67c485eee51a098c7b34544c5d18bf725af (patch)
tree31e0c087b57c538ef91b6598040f2b7f2293505d /views/controls
parentfbc7678b2f73707962861c99eb4c809604ddd611 (diff)
downloadchromium_src-bdaab67c485eee51a098c7b34544c5d18bf725af.zip
chromium_src-bdaab67c485eee51a098c7b34544c5d18bf725af.tar.gz
chromium_src-bdaab67c485eee51a098c7b34544c5d18bf725af.tar.bz2
Remove wstring from TableModel.
BUG=23581 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6044007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/table/native_table_gtk.cc8
-rw-r--r--views/controls/table/table_view_unittest.cc17
2 files changed, 13 insertions, 12 deletions
diff --git a/views/controls/table/native_table_gtk.cc b/views/controls/table/native_table_gtk.cc
index 75f724b..fb12ef4 100644
--- a/views/controls/table/native_table_gtk.cc
+++ b/views/controls/table/native_table_gtk.cc
@@ -278,7 +278,7 @@ void NativeTableGtk::CreateNativeControl() {
void NativeTableGtk::InsertTextColumn(const TableColumn& column, int index) {
GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes(tree_view_, -1,
- WideToUTF8(column.title).c_str(),
+ UTF16ToUTF8(column.title).c_str(),
renderer, "text", index, NULL);
}
@@ -290,7 +290,7 @@ void NativeTableGtk::InsertIconAndTextColumn(const TableColumn& column,
" at this point.";
GtkTreeViewColumn* gtk_column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(gtk_column, WideToUTF8(column.title).c_str());
+ gtk_tree_view_column_set_title(gtk_column, UTF16ToUTF8(column.title).c_str());
GtkCellRenderer* renderer = gtk_cell_renderer_pixbuf_new();
gtk_tree_view_column_pack_start(gtk_column, renderer, FALSE);
// First we set the icon renderer at index 0.
@@ -315,8 +315,8 @@ void NativeTableGtk::SetRowData(int row_index, GtkTreeIter* iter) {
for (size_t i = 0; i < table_->GetVisibleColumnCount();
++i, ++gtk_column_index) {
std::string text =
- WideToUTF8(table_->model()->GetText(row_index,
- table_->GetVisibleColumnAt(i).id));
+ UTF16ToUTF8(table_->model()->GetText(row_index,
+ table_->GetVisibleColumnAt(i).id));
gtk_list_store_set(gtk_model_, iter, gtk_column_index, text.c_str(), -1);
}
}
diff --git a/views/controls/table/table_view_unittest.cc b/views/controls/table/table_view_unittest.cc
index 2959534..bc51c4a 100644
--- a/views/controls/table/table_view_unittest.cc
+++ b/views/controls/table/table_view_unittest.cc
@@ -6,6 +6,7 @@
#include "app/table_model.h"
#include "app/table_model_observer.h"
+#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
@@ -47,10 +48,10 @@ class TestTableModel : public TableModel {
void ChangeRow(int row, int c1_value, int c2_value);
// TableModel
- virtual int RowCount();
- virtual std::wstring GetText(int row, int column_id);
- virtual void SetObserver(TableModelObserver* observer);
- virtual int CompareValues(int row1, int row2, int column_id);
+ virtual int RowCount() OVERRIDE;
+ virtual string16 GetText(int row, int column_id) OVERRIDE;
+ virtual void SetObserver(TableModelObserver* observer) OVERRIDE;
+ virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE;
private:
TableModelObserver* observer_;
@@ -69,9 +70,9 @@ class GroupTestTableModel : public TestTableModel {
virtual Groups GetGroups() {
Groups groups;
Group group1, group2;
- group1.title = L"Group 1";
+ group1.title = ASCIIToUTF16("Group 1");
group1.id = 0;
- group2.title = L"Group 2";
+ group2.title = ASCIIToUTF16("Group 2");
group2.id = 0;
groups.push_back(group1);
groups.push_back(group2);
@@ -116,8 +117,8 @@ int TestTableModel::RowCount() {
return static_cast<int>(rows_.size());
}
-std::wstring TestTableModel::GetText(int row, int column_id) {
- return UTF8ToWide(base::IntToString(rows_[row][column_id]));
+string16 TestTableModel::GetText(int row, int column_id) {
+ return UTF8ToUTF16(base::IntToString(rows_[row][column_id]));
}
void TestTableModel::SetObserver(TableModelObserver* observer) {