OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/controls/table/table_view.h" | 5 #include "ui/views/controls/table/table_view.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 row_height_(font_.GetHeight() + kTextVerticalPadding * 2), | 127 row_height_(font_.GetHeight() + kTextVerticalPadding * 2), |
128 last_parent_width_(0), | 128 last_parent_width_(0), |
129 layout_width_(0), | 129 layout_width_(0), |
130 grouper_(NULL), | 130 grouper_(NULL), |
131 in_set_visible_column_width_(false) { | 131 in_set_visible_column_width_(false) { |
132 for (size_t i = 0; i < columns.size(); ++i) { | 132 for (size_t i = 0; i < columns.size(); ++i) { |
133 VisibleColumn visible_column; | 133 VisibleColumn visible_column; |
134 visible_column.column = columns[i]; | 134 visible_column.column = columns[i]; |
135 visible_columns_.push_back(visible_column); | 135 visible_columns_.push_back(visible_column); |
136 } | 136 } |
137 set_focusable(true); | 137 SetFocusable(true); |
138 SetModel(model); | 138 SetModel(model); |
139 } | 139 } |
140 | 140 |
141 TableView::~TableView() { | 141 TableView::~TableView() { |
142 if (model_) | 142 if (model_) |
143 model_->SetObserver(NULL); | 143 model_->SetObserver(NULL); |
144 } | 144 } |
145 | 145 |
146 // TODO: this doesn't support arbitrarily changing the model, rename this to | 146 // TODO: this doesn't support arbitrarily changing the model, rename this to |
147 // ClearModel() or something. | 147 // ClearModel() or something. |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 if (tooltip) | 898 if (tooltip) |
899 *tooltip = text; | 899 *tooltip = text; |
900 if (tooltip_origin) { | 900 if (tooltip_origin) { |
901 tooltip_origin->SetPoint(cell_bounds.x(), | 901 tooltip_origin->SetPoint(cell_bounds.x(), |
902 cell_bounds.y() + kTextVerticalPadding); | 902 cell_bounds.y() + kTextVerticalPadding); |
903 } | 903 } |
904 return true; | 904 return true; |
905 } | 905 } |
906 | 906 |
907 } // namespace views | 907 } // namespace views |
OLD | NEW |