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/tree/tree_view.h" | 5 #include "ui/views/controls/tree/tree_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 : model_(NULL), | 74 : model_(NULL), |
75 selected_node_(NULL), | 75 selected_node_(NULL), |
76 editing_(false), | 76 editing_(false), |
77 editor_(NULL), | 77 editor_(NULL), |
78 focus_manager_(NULL), | 78 focus_manager_(NULL), |
79 auto_expand_children_(false), | 79 auto_expand_children_(false), |
80 editable_(true), | 80 editable_(true), |
81 controller_(NULL), | 81 controller_(NULL), |
82 root_shown_(true), | 82 root_shown_(true), |
83 row_height_(font_list_.GetHeight() + kTextVerticalPadding * 2) { | 83 row_height_(font_list_.GetHeight() + kTextVerticalPadding * 2) { |
| 84 // Always focusable, even on Mac (consistent with NSOutlineView). |
84 SetFocusBehavior(FocusBehavior::ALWAYS); | 85 SetFocusBehavior(FocusBehavior::ALWAYS); |
85 closed_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 86 closed_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
86 (base::i18n::IsRTL() ? IDR_FOLDER_CLOSED_RTL | 87 (base::i18n::IsRTL() ? IDR_FOLDER_CLOSED_RTL |
87 : IDR_FOLDER_CLOSED)).ToImageSkia(); | 88 : IDR_FOLDER_CLOSED)).ToImageSkia(); |
88 open_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 89 open_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
89 (base::i18n::IsRTL() ? IDR_FOLDER_OPEN_RTL | 90 (base::i18n::IsRTL() ? IDR_FOLDER_OPEN_RTL |
90 : IDR_FOLDER_OPEN)).ToImageSkia(); | 91 : IDR_FOLDER_OPEN)).ToImageSkia(); |
91 text_offset_ = closed_icon_.width() + kImagePadding + kImagePadding + | 92 text_offset_ = closed_icon_.width() + kImagePadding + kImagePadding + |
92 kArrowRegionSize; | 93 kArrowRegionSize; |
93 } | 94 } |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 if (!is_expanded_) | 1044 if (!is_expanded_) |
1044 return max_width; | 1045 return max_width; |
1045 for (int i = 0; i < child_count(); ++i) { | 1046 for (int i = 0; i < child_count(); ++i) { |
1046 max_width = std::max(max_width, | 1047 max_width = std::max(max_width, |
1047 GetChild(i)->GetMaxWidth(indent, depth + 1)); | 1048 GetChild(i)->GetMaxWidth(indent, depth + 1)); |
1048 } | 1049 } |
1049 return max_width; | 1050 return max_width; |
1050 } | 1051 } |
1051 | 1052 |
1052 } // namespace views | 1053 } // namespace views |
OLD | NEW |