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

Unified Diff: views/examples/table2_example.h

Issue 6038006: Leftover wstring removal from r70290 (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: headers 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/examples/table2_example.h
diff --git a/views/examples/table2_example.h b/views/examples/table2_example.h
index c58b073c7b4e648e5055ff2901b13dc09b96020c..ed03e87ed0eadc0d64d9646e601d62cc4269a6c4 100644
--- a/views/examples/table2_example.h
+++ b/views/examples/table2_example.h
@@ -6,10 +6,11 @@
#define VIEWS_EXAMPLES_TABLE2_EXAMPLE_H_
#pragma once
+#include <string>
#include <vector>
#include "app/table_model.h"
-#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "views/controls/button/checkbox.h"
#include "views/controls/table/table_view_observer.h"
@@ -51,10 +52,14 @@ class Table2Example
container->SetLayoutManager(layout);
std::vector<TableColumn> columns;
- columns.push_back(TableColumn(0, L"Fruit", TableColumn::LEFT, 100));
- columns.push_back(TableColumn(1, L"Color", TableColumn::LEFT, 100));
- columns.push_back(TableColumn(2, L"Origin", TableColumn::LEFT, 100));
- columns.push_back(TableColumn(3, L"Price", TableColumn::LEFT, 100));
+ columns.push_back(TableColumn(0, ASCIIToUTF16("Fruit"), TableColumn::LEFT,
+ 100));
+ columns.push_back(TableColumn(1, ASCIIToUTF16("Color"), TableColumn::LEFT,
+ 100));
+ columns.push_back(TableColumn(2, ASCIIToUTF16("Origin"), TableColumn::LEFT,
+ 100));
+ columns.push_back(TableColumn(3, ASCIIToUTF16("Price"), TableColumn::LEFT,
+ 100));
const int options = (views::TableView2::SINGLE_SELECTION |
views::TableView2::RESIZABLE_COLUMNS |
views::TableView2::AUTOSIZE_COLUMNS |
@@ -102,15 +107,15 @@ class Table2Example
return 10;
}
- virtual std::wstring 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" },
+ virtual string16 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]);
}
virtual SkBitmap GetIcon(int row) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698