OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "app/table_model.h" | 5 #include "app/table_model.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/l10n_util_collator.h" | 8 #include "app/l10n_util_collator.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // It's common (but not required) to use the title's IDS_* tag as the column | 47 // It's common (but not required) to use the title's IDS_* tag as the column |
48 // id. In this case, the provided conveniences look up the title string on | 48 // id. In this case, the provided conveniences look up the title string on |
49 // bahalf of the caller. | 49 // bahalf of the caller. |
50 TableColumn::TableColumn(int id, Alignment alignment, int width) | 50 TableColumn::TableColumn(int id, Alignment alignment, int width) |
51 : id(id), | 51 : id(id), |
52 alignment(alignment), | 52 alignment(alignment), |
53 width(width), | 53 width(width), |
54 percent(0), | 54 percent(0), |
55 min_visible_width(0), | 55 min_visible_width(0), |
56 sortable(false) { | 56 sortable(false) { |
57 title = l10n_util::GetString(id); | 57 title = UTF16ToWide(l10n_util::GetStringUTF16(id)); |
58 } | 58 } |
59 | 59 |
60 TableColumn::TableColumn(int id, Alignment alignment, int width, float percent) | 60 TableColumn::TableColumn(int id, Alignment alignment, int width, float percent) |
61 : id(id), | 61 : id(id), |
62 alignment(alignment), | 62 alignment(alignment), |
63 width(width), | 63 width(width), |
64 percent(percent), | 64 percent(percent), |
65 min_visible_width(0), | 65 min_visible_width(0), |
66 sortable(false) { | 66 sortable(false) { |
67 title = l10n_util::GetString(id); | 67 title = UTF16ToWide(l10n_util::GetStringUTF16(id)); |
68 } | 68 } |
69 | 69 |
70 // TableModel ----------------------------------------------------------------- | 70 // TableModel ----------------------------------------------------------------- |
71 | 71 |
72 // Used for sorting. | 72 // Used for sorting. |
73 static icu::Collator* collator = NULL; | 73 static icu::Collator* collator = NULL; |
74 | 74 |
75 SkBitmap TableModel::GetIcon(int row) { | 75 SkBitmap TableModel::GetIcon(int row) { |
76 return SkBitmap(); | 76 return SkBitmap(); |
77 } | 77 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 NOTREACHED(); | 125 NOTREACHED(); |
126 } | 126 } |
127 } | 127 } |
128 return collator; | 128 return collator; |
129 } | 129 } |
130 | 130 |
131 void TableModel::ClearCollator() { | 131 void TableModel::ClearCollator() { |
132 delete collator; | 132 delete collator; |
133 collator = NULL; | 133 collator = NULL; |
134 } | 134 } |
OLD | NEW |