Chromium Code Reviews| 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 "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 | 68 |
| 69 // TableModel ----------------------------------------------------------------- | 69 // TableModel ----------------------------------------------------------------- |
| 70 | 70 |
| 71 // Used for sorting. | 71 // Used for sorting. |
| 72 static icu::Collator* collator = NULL; | 72 static icu::Collator* collator = NULL; |
| 73 | 73 |
| 74 SkBitmap TableModel::GetIcon(int row) { | 74 SkBitmap TableModel::GetIcon(int row) { |
| 75 return SkBitmap(); | 75 return SkBitmap(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 std::wstring TableModel::GetTooltip(int row) { | |
| 79 return std::wstring(); | |
| 80 } | |
| 81 | |
| 82 bool TableModel::HasGroups() { | |
| 83 return false; | |
| 84 } | |
| 85 | |
| 86 TableModel::Groups TableModel::GetGroups() { | |
| 87 // If you override HasGroups to return true, you must override this as | |
| 88 // well. | |
| 89 NOTREACHED(); | |
|
Lei Zhang
2010/09/23 22:05:41
can you #include logging.h and not implicitly depe
| |
| 90 return std::vector<Group>(); | |
| 91 } | |
| 92 | |
| 93 int TableModel::GetGroupID(int row) { | |
| 94 // If you override HasGroups to return true, you must override this as | |
| 95 // well. | |
| 96 NOTREACHED(); | |
| 97 return 0; | |
| 98 } | |
| 99 | |
| 78 int TableModel::CompareValues(int row1, int row2, int column_id) { | 100 int TableModel::CompareValues(int row1, int row2, int column_id) { |
| 79 DCHECK(row1 >= 0 && row1 < RowCount() && | 101 DCHECK(row1 >= 0 && row1 < RowCount() && |
| 80 row2 >= 0 && row2 < RowCount()); | 102 row2 >= 0 && row2 < RowCount()); |
| 81 std::wstring value1 = GetText(row1, column_id); | 103 std::wstring value1 = GetText(row1, column_id); |
| 82 std::wstring value2 = GetText(row2, column_id); | 104 std::wstring value2 = GetText(row2, column_id); |
| 83 icu::Collator* collator = GetCollator(); | 105 icu::Collator* collator = GetCollator(); |
| 84 | 106 |
| 85 if (collator) | 107 if (collator) |
| 86 return l10n_util::CompareStringWithCollator(collator, value1, value2); | 108 return l10n_util::CompareStringWithCollator(collator, value1, value2); |
| 87 | 109 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 98 NOTREACHED(); | 120 NOTREACHED(); |
| 99 } | 121 } |
| 100 } | 122 } |
| 101 return collator; | 123 return collator; |
| 102 } | 124 } |
| 103 | 125 |
| 104 void TableModel::ClearCollator() { | 126 void TableModel::ClearCollator() { |
| 105 delete collator; | 127 delete collator; |
| 106 collator = NULL; | 128 collator = NULL; |
| 107 } | 129 } |
| OLD | NEW |