Commit 9c29c5a5 authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Delete unused methods from TableModel.

The methods appear to have been added long ago to support an old design
of the Task Manager.

Bug: 
Change-Id: Ief7019d0017ae187040542a580dfb7e99abf5cf8
Reviewed-on: https://chromium-review.googlesource.com/803746Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521510}
parent 5092d748
......@@ -16,11 +16,6 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/table_model_observer.h"
// Group IDs used by TemplateURLTableModel.
static const int kMainGroupID = 0;
static const int kOtherGroupID = 1;
static const int kExtensionGroupID = 2;
TemplateURLTableModel::TemplateURLTableModel(
TemplateURLService* template_url_service)
: observer_(NULL), template_url_service_(template_url_service) {
......@@ -96,41 +91,6 @@ void TemplateURLTableModel::SetObserver(ui::TableModelObserver* observer) {
observer_ = observer;
}
bool TemplateURLTableModel::HasGroups() {
return true;
}
TemplateURLTableModel::Groups TemplateURLTableModel::GetGroups() {
Groups groups;
Group search_engine_group;
search_engine_group.title =
l10n_util::GetStringUTF16(IDS_SEARCH_ENGINES_EDITOR_MAIN_SEPARATOR);
search_engine_group.id = kMainGroupID;
groups.push_back(search_engine_group);
Group other_group;
other_group.title =
l10n_util::GetStringUTF16(IDS_SEARCH_ENGINES_EDITOR_OTHER_SEPARATOR);
other_group.id = kOtherGroupID;
groups.push_back(other_group);
Group extension_group;
extension_group.title =
l10n_util::GetStringUTF16(IDS_SEARCH_ENGINES_EDITOR_EXTENSIONS_SEPARATOR);
extension_group.id = kExtensionGroupID;
groups.push_back(extension_group);
return groups;
}
int TemplateURLTableModel::GetGroupID(int row) {
DCHECK(row >= 0 && row < RowCount());
if (row < last_search_engine_index_)
return kMainGroupID;
return row < last_other_engine_index_ ? kOtherGroupID : kExtensionGroupID;
}
void TemplateURLTableModel::Remove(int index) {
// Remove the observer while we modify the model, that way we don't need to
// worry about the model calling us back when we mutate it.
......
......@@ -44,9 +44,6 @@ class TemplateURLTableModel : public ui::TableModel,
int RowCount() override;
base::string16 GetText(int row, int column) override;
void SetObserver(ui::TableModelObserver* observer) override;
bool HasGroups() override;
Groups GetGroups() override;
int GetGroupID(int row) override;
// Removes the entry at the specified index.
void Remove(int index);
......
......@@ -50,28 +50,6 @@ 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());
......
......@@ -22,16 +22,6 @@ class TableModelObserver;
// The model driving the TableView.
class UI_BASE_EXPORT TableModel {
public:
// See HasGroups, get GetGroupID for details as to how this is used.
struct Group {
// The title text for the group.
base::string16 title;
// Unique id for the group.
int id;
};
typedef std::vector<Group> Groups;
// Number of rows in the model.
virtual int RowCount() = 0;
......@@ -49,25 +39,6 @@ class UI_BASE_EXPORT TableModel {
// column zero.
virtual base::string16 GetTooltip(int row);
// If true, this row should be indented.
virtual bool ShouldIndent(int row);
// Returns true if the TableView has groups. Groups provide a way to visually
// delineate the rows in a table view. When groups are enabled table view
// shows a visual separator for each group, followed by all the rows in
// the group.
//
// On win2k a visual separator is not rendered for the group headers.
virtual bool HasGroups();
// Returns the groups.
// This is only used if HasGroups returns true.
virtual Groups GetGroups();
// Returns the group id of the specified row.
// This is only used if HasGroups returns true.
virtual int GetGroupID(int row);
// Sets the observer for the model. The TableView should NOT take ownership
// of the observer.
virtual void SetObserver(TableModelObserver* observer) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment