diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/examples/table_example.cc | 17 | ||||
-rw-r--r-- | views/examples/table_example.h | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/views/examples/table_example.cc b/views/examples/table_example.cc index 62cc2bf..e568514e 100644 --- a/views/examples/table_example.cc +++ b/views/examples/table_example.cc @@ -6,6 +6,7 @@ #include <vector> +#include "base/utf_string_conversions.h" #include "third_party/skia/include/core/SkCanvas.h" #include "views/controls/button/checkbox.h" #include "views/layout/grid_layout.h" @@ -82,15 +83,15 @@ int TableExample::RowCount() { return 10; } -std::wstring TableExample::GetText(int row, int column_id) { - std::wstring cells[5][5] = { - { L"Orange", L"Orange", L"South america", L"$5" }, - { L"Apple", L"Green", L"Canada", L"$3" }, - { L"Blue berries", L"Blue", L"Mexico", L"$10.3" }, - { L"Strawberries", L"Red", L"California", L"$7" }, - { L"Cantaloupe", L"Orange", L"South america", L"$5" }, +string16 TableExample::GetText(int row, int column_id) { + const char* const cells[5][4] = { + { "Orange", "Orange", "South america", "$5" }, + { "Apple", "Green", "Canada", "$3" }, + { "Blue berries", "Blue", "Mexico", "$10.3" }, + { "Strawberries", "Red", "California", "$7" }, + { "Cantaloupe", "Orange", "South america", "$5" }, }; - return cells[row % 5][column_id]; + return ASCIIToUTF16(cells[row % 5][column_id]); } SkBitmap TableExample::GetIcon(int row) { diff --git a/views/examples/table_example.h b/views/examples/table_example.h index 6c81059..6074ee4 100644 --- a/views/examples/table_example.h +++ b/views/examples/table_example.h @@ -38,7 +38,7 @@ class TableExample : public ExampleBase, // ui::TableModel: virtual int RowCount() OVERRIDE; - virtual std::wstring GetText(int row, int column_id) OVERRIDE; + virtual string16 GetText(int row, int column_id) OVERRIDE; virtual SkBitmap GetIcon(int row) OVERRIDE; virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; |