summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 21:08:56 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 21:08:56 +0000
commit312200a31582330d0c68b9c29ab9aa10775c3568 (patch)
treeec474055482e8d7d2c8746b772cb2e504d89890e /chrome/common
parent984de557ddb857f79886a24677ce2e6c1f9162b5 (diff)
downloadchromium_src-312200a31582330d0c68b9c29ab9aa10775c3568.zip
chromium_src-312200a31582330d0c68b9c29ab9aa10775c3568.tar.gz
chromium_src-312200a31582330d0c68b9c29ab9aa10775c3568.tar.bz2
Rename gtk_tree::ModelAdapter to TableAdapter in preparation for adding TreeAdapter.
BUG=none TEST=none Review URL: http://codereview.chromium.org/374007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31293 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/gtk_tree.cc16
-rw-r--r--chrome/common/gtk_tree.h8
2 files changed, 12 insertions, 12 deletions
diff --git a/chrome/common/gtk_tree.cc b/chrome/common/gtk_tree.cc
index de9df51..722aab2 100644
--- a/chrome/common/gtk_tree.cc
+++ b/chrome/common/gtk_tree.cc
@@ -51,21 +51,21 @@ void SelectAndFocusRowNum(int row, GtkTreeView* tree_view) {
}
////////////////////////////////////////////////////////////////////////////////
-// ModelAdapter
+// TableAdapter
-ModelAdapter::ModelAdapter(Delegate* delegate, GtkListStore* list_store,
+TableAdapter::TableAdapter(Delegate* delegate, GtkListStore* list_store,
TableModel* table_model)
: delegate_(delegate), list_store_(list_store), table_model_(table_model) {
if (table_model)
table_model->SetObserver(this);
}
-void ModelAdapter::SetModel(TableModel* table_model) {
+void TableAdapter::SetModel(TableModel* table_model) {
table_model_ = table_model;
table_model_->SetObserver(this);
}
-void ModelAdapter::AddNodeToList(int row) {
+void TableAdapter::AddNodeToList(int row) {
GtkTreeIter iter;
if (row == 0) {
gtk_list_store_prepend(list_store_, &iter);
@@ -79,7 +79,7 @@ void ModelAdapter::AddNodeToList(int row) {
delegate_->SetColumnValues(row, &iter);
}
-void ModelAdapter::OnModelChanged() {
+void TableAdapter::OnModelChanged() {
delegate_->OnAnyModelUpdateStart();
gtk_list_store_clear(list_store_);
delegate_->OnModelChanged();
@@ -88,7 +88,7 @@ void ModelAdapter::OnModelChanged() {
delegate_->OnAnyModelUpdate();
}
-void ModelAdapter::OnItemsChanged(int start, int length) {
+void TableAdapter::OnItemsChanged(int start, int length) {
delegate_->OnAnyModelUpdateStart();
GtkTreeIter iter;
bool rv = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(list_store_), &iter,
@@ -104,7 +104,7 @@ void ModelAdapter::OnItemsChanged(int start, int length) {
delegate_->OnAnyModelUpdate();
}
-void ModelAdapter::OnItemsAdded(int start, int length) {
+void TableAdapter::OnItemsAdded(int start, int length) {
delegate_->OnAnyModelUpdateStart();
for (int i = 0; i < length; ++i) {
AddNodeToList(start + i);
@@ -112,7 +112,7 @@ void ModelAdapter::OnItemsAdded(int start, int length) {
delegate_->OnAnyModelUpdate();
}
-void ModelAdapter::OnItemsRemoved(int start, int length) {
+void TableAdapter::OnItemsRemoved(int start, int length) {
delegate_->OnAnyModelUpdateStart();
GtkTreeIter iter;
bool rv = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(list_store_), &iter,
diff --git a/chrome/common/gtk_tree.h b/chrome/common/gtk_tree.h
index e0f7ba8..af9aa88 100644
--- a/chrome/common/gtk_tree.h
+++ b/chrome/common/gtk_tree.h
@@ -29,7 +29,7 @@ gint GetTreeSortChildRowNumForPath(GtkTreeModel* sort_model,
void SelectAndFocusRowNum(int row, GtkTreeView* tree_view);
// A helper class for populating a GtkListStore from a TableModel.
-class ModelAdapter : public TableModelObserver {
+class TableAdapter : public TableModelObserver {
public:
class Delegate {
public:
@@ -49,9 +49,9 @@ class ModelAdapter : public TableModelObserver {
};
// |table_model| may be NULL.
- explicit ModelAdapter(Delegate* delegate, GtkListStore* list_store,
+ explicit TableAdapter(Delegate* delegate, GtkListStore* list_store,
TableModel* table_model);
- virtual ~ModelAdapter() {}
+ virtual ~TableAdapter() {}
// Replace the TableModel with a different one. If the list store currenty
// has items this would cause weirdness, so this should generally only be
@@ -73,7 +73,7 @@ class ModelAdapter : public TableModelObserver {
GtkListStore* list_store_;
TableModel* table_model_;
- DISALLOW_COPY_AND_ASSIGN(ModelAdapter);
+ DISALLOW_COPY_AND_ASSIGN(TableAdapter);
};
} // namespace gtk_tree