summaryrefslogtreecommitdiffstats
path: root/views/controls/table
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 14:55:09 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 14:55:09 +0000
commitd2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe (patch)
treee66610ffde53c34e58f671b92092b69e714268f2 /views/controls/table
parentfbde2f7efff4198e4138e1f202395dacc1847da6 (diff)
downloadchromium_src-d2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe.zip
chromium_src-d2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe.tar.gz
chromium_src-d2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe.tar.bz2
Revert r51526 (Auto-size the views version of the options dialog.)
Unexpected unit_tests crash on chromeos. TBR: mnissler git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/table')
-rw-r--r--views/controls/table/table_view.cc14
-rw-r--r--views/controls/table/table_view.h8
2 files changed, 8 insertions, 14 deletions
diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc
index 7ab4c91..8b86a6e 100644
--- a/views/controls/table/table_view.cc
+++ b/views/controls/table/table_view.cc
@@ -64,6 +64,7 @@ TableView::TableView(TableModel* model,
single_selection_(single_selection),
ignore_listview_change_(false),
custom_colors_enabled_(false),
+ sized_columns_(false),
autosize_columns_(autosize_columns),
resizable_columns_(resizable_columns),
list_view_(NULL),
@@ -132,8 +133,10 @@ void TableView::DidChangeBounds(const gfx::Rect& previous,
return;
SendMessage(list_view_, WM_SETREDRAW, static_cast<WPARAM>(FALSE), 0);
Layout();
- if (autosize_columns_ && width() > 0)
+ if ((!sized_columns_ || autosize_columns_) && width() > 0) {
+ sized_columns_ = true;
ResetColumnSizes();
+ }
UpdateContentOffset();
SendMessage(list_view_, WM_SETREDRAW, static_cast<WPARAM>(TRUE), 0);
}
@@ -1548,15 +1551,6 @@ gfx::Font TableView::GetAltTextFont() {
return ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont);
}
-void TableView::VisibilityChanged(View* starting_from, bool is_visible) {
- // GetClientRect as used by ResetColumnSize to obtain the total width
- // available to the columns only works when the native control is visible, so
- // update the column sizes in case we become visible. This depends on
- // VisibilityChanged() being called in post order on the view tree.
- if (is_visible && autosize_columns_)
- ResetColumnSizes();
-}
-
//
// TableSelectionIterator
diff --git a/views/controls/table/table_view.h b/views/controls/table/table_view.h
index 28d877e..f237df2 100644
--- a/views/controls/table/table_view.h
+++ b/views/controls/table/table_view.h
@@ -407,10 +407,6 @@ class TableView : public NativeControl,
// Returns the font used for alt text.
gfx::Font GetAltTextFont();
- // Overriden in order to update the column sizes, which can only be sized
- // accurately when the native control is available.
- virtual void VisibilityChanged(View* starting_from, bool is_visible);
-
TableModel* model_;
TableTypes table_type_;
TableViewObserver* table_view_observer_;
@@ -436,6 +432,10 @@ class TableView : public NativeControl,
// Reflects the value passed to SetCustomColorsEnabled.
bool custom_colors_enabled_;
+ // Whether or not the columns have been sized in the ListView. This is
+ // set to true the first time Layout() is invoked and we have a valid size.
+ bool sized_columns_;
+
// Whether or not columns should automatically be resized to fill the
// the available width when the list view is resized.
bool autosize_columns_;