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

Unified Diff: ui/base/models/table_model.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months 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 | « ui/base/models/table_model.h ('k') | ui/base/models/table_model_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/models/table_model.cc
diff --git a/ui/base/models/table_model.cc b/ui/base/models/table_model.cc
deleted file mode 100644
index 37a866f1ea2bc1f7f31ca391078031c77dedfc34..0000000000000000000000000000000000000000
--- a/ui/base/models/table_model.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/base/models/table_model.h"
-
-#include "base/i18n/string_compare.h"
-#include "base/logging.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/image/image_skia.h"
-
-namespace ui {
-
-// TableColumn -----------------------------------------------------------------
-
-TableColumn::TableColumn()
- : id(0),
- title(),
- alignment(LEFT),
- width(-1),
- percent(),
- min_visible_width(0),
- sortable(false) {
-}
-
-TableColumn::TableColumn(int id, Alignment alignment, int width, float percent)
- : id(id),
- title(l10n_util::GetStringUTF16(id)),
- alignment(alignment),
- width(width),
- percent(percent),
- min_visible_width(0),
- sortable(false) {
-}
-
-// TableModel -----------------------------------------------------------------
-
-// Used for sorting.
-static icu::Collator* collator = NULL;
-
-gfx::ImageSkia TableModel::GetIcon(int row) {
- return gfx::ImageSkia();
-}
-
-base::string16 TableModel::GetTooltip(int row) {
- return base::string16();
-}
-
-bool TableModel::ShouldIndent(int row) {
- return false;
-}
-
-bool TableModel::HasGroups() {
- return false;
-}
-
-TableModel::Groups TableModel::GetGroups() {
- // If you override HasGroups to return true, you must override this as
- // well.
- NOTREACHED();
- return std::vector<Group>();
-}
-
-int TableModel::GetGroupID(int row) {
- // If you override HasGroups to return true, you must override this as
- // well.
- NOTREACHED();
- return 0;
-}
-
-int TableModel::CompareValues(int row1, int row2, int column_id) {
- DCHECK(row1 >= 0 && row1 < RowCount() &&
- row2 >= 0 && row2 < RowCount());
- base::string16 value1 = GetText(row1, column_id);
- base::string16 value2 = GetText(row2, column_id);
- icu::Collator* collator = GetCollator();
-
- if (collator)
- return base::i18n::CompareString16WithCollator(collator, value1, value2);
-
- NOTREACHED();
- return 0;
-}
-
-void TableModel::ClearCollator() {
- delete collator;
- collator = NULL;
-}
-
-icu::Collator* TableModel::GetCollator() {
- if (!collator) {
- UErrorCode create_status = U_ZERO_ERROR;
- collator = icu::Collator::createInstance(create_status);
- if (!U_SUCCESS(create_status)) {
- collator = NULL;
- NOTREACHED();
- }
- }
- return collator;
-}
-
-} // namespace ui
« no previous file with comments | « ui/base/models/table_model.h ('k') | ui/base/models/table_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698