summaryrefslogtreecommitdiffstats
path: root/chrome/views/table_view.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-24 22:58:08 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-24 22:58:08 +0000
commit62ca321dd5cd95b7e4fc9de922c2ca0703971361 (patch)
treece782f196bd0933352bffae1130fd365a626ce25 /chrome/views/table_view.h
parent9d6326fae66278988d0eb3f9d5b44e7d9f31870e (diff)
downloadchromium_src-62ca321dd5cd95b7e4fc9de922c2ca0703971361.zip
chromium_src-62ca321dd5cd95b7e4fc9de922c2ca0703971361.tar.gz
chromium_src-62ca321dd5cd95b7e4fc9de922c2ca0703971361.tar.bz2
Handful of changes to NativeControl, TreeView and TableView I'm going
to need for the bookmark manager. Specifically: . NativeController now delegates OnContextMenu to the ContextMenuController. . TableView allows a NULL model. . TableView::SetColumns was buggy. . Added a method that TableView invokes after painting. . Added methods to TreeView for getting various state information. BUG=674 TEST=make sure the various places in the UI we uses trees and table work fine: cookies table, passwords table, task manager, bookmark editor, search engines. Review URL: http://codereview.chromium.org/8145 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/table_view.h')
-rw-r--r--chrome/views/table_view.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/views/table_view.h b/chrome/views/table_view.h
index ab92a86..10c4b65 100644
--- a/chrome/views/table_view.h
+++ b/chrome/views/table_view.h
@@ -333,6 +333,7 @@ class TableView : public NativeControl,
// should be called in the containing view's destructor to avoid destruction
// issues when the model needs to be deleted before the table.
void SetModel(TableModel* model);
+ TableModel* model() const { return model_; }
// Resorts the contents.
void SetSortDescriptors(const SortDescriptors& sort_descriptors);
@@ -455,6 +456,7 @@ class TableView : public NativeControl,
// Subclasses can implement in this method extra-painting for cells.
virtual void PostPaint(int model_row, int column, bool selected,
const CRect& bounds, HDC device_context) { }
+ virtual void PostPaint() {}
virtual HWND CreateNativeControl(HWND parent_container);
@@ -472,6 +474,14 @@ class TableView : public NativeControl,
// that need to cache state used during sorting.
virtual void PrepareForSort() {}
+ // Returns the width of the specified column by id, or -1 if the column isn't
+ // visible.
+ int GetColumnWidth(int column_id);
+
+ // Returns the offset from the top of the client area to the start of the
+ // content.
+ int content_offset() const { return content_offset_; }
+
private:
// Direction of a sort.
enum SortDirection {
@@ -630,7 +640,6 @@ class TableView : public NativeControl,
// The preferred size of the table view.
gfx::Size preferred_size_;
- // The offset from the top of the client area to the start of the content.
int content_offset_;
// Current sort.