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_win.h" | 5 #include "ui/views/controls/table/table_view_win.h" |
6 | 6 |
7 #include <commctrl.h> | 7 #include <commctrl.h> |
8 #include <windowsx.h> | 8 #include <windowsx.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 if (list_view_ && model_) | 96 if (list_view_ && model_) |
97 model_->SetObserver(NULL); | 97 model_->SetObserver(NULL); |
98 model_ = model; | 98 model_ = model; |
99 if (list_view_ && model_) | 99 if (list_view_ && model_) |
100 model_->SetObserver(this); | 100 model_->SetObserver(this); |
101 if (list_view_) | 101 if (list_view_) |
102 OnModelChanged(); | 102 OnModelChanged(); |
103 } | 103 } |
104 | 104 |
| 105 View* TableView::CreateParentIfNecessary() { |
| 106 return this; |
| 107 } |
| 108 |
105 void TableView::SetSortDescriptors(const SortDescriptors& sort_descriptors) { | 109 void TableView::SetSortDescriptors(const SortDescriptors& sort_descriptors) { |
106 if (!sort_descriptors_.empty()) { | 110 if (!sort_descriptors_.empty()) { |
107 ResetColumnSortImage(sort_descriptors_[0].column_id, | 111 ResetColumnSortImage(sort_descriptors_[0].column_id, |
108 NO_SORT); | 112 NO_SORT); |
109 } | 113 } |
110 sort_descriptors_ = sort_descriptors; | 114 sort_descriptors_ = sort_descriptors; |
111 if (!sort_descriptors_.empty()) { | 115 if (!sort_descriptors_.empty()) { |
112 ResetColumnSortImage( | 116 ResetColumnSortImage( |
113 sort_descriptors_[0].column_id, | 117 sort_descriptors_[0].column_id, |
114 sort_descriptors_[0].ascending ? ASCENDING_SORT : DESCENDING_SORT); | 118 sort_descriptors_[0].ascending ? ASCENDING_SORT : DESCENDING_SORT); |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 } | 1639 } |
1636 | 1640 |
1637 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { | 1641 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { |
1638 if (view_index_ == -1) | 1642 if (view_index_ == -1) |
1639 model_index_ = -1; | 1643 model_index_ = -1; |
1640 else | 1644 else |
1641 model_index_ = table_view_->ViewToModel(view_index_); | 1645 model_index_ = table_view_->ViewToModel(view_index_); |
1642 } | 1646 } |
1643 | 1647 |
1644 } // namespace views | 1648 } // namespace views |
OLD | NEW |