| 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_views.h" | 5 #include "ui/views/controls/tree/tree_view_views.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.h" | 10 #include "base/message_loop.h" |
| 11 #include "grit/ui_resources.h" | 11 #include "grit/ui_resources.h" |
| 12 #include "ui/base/accessibility/accessible_view_state.h" | 12 #include "ui/base/accessibility/accessible_view_state.h" |
| 13 #include "ui/base/keycodes/keyboard_codes.h" | 13 #include "ui/base/keycodes/keyboard_codes.h" |
| 14 #include "ui/base/native_theme/native_theme.h" | |
| 15 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/gfx/canvas.h" | 15 #include "ui/gfx/canvas.h" |
| 17 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
| 17 #include "ui/gfx/native_theme.h" |
| 18 #include "ui/gfx/skia_util.h" | 18 #include "ui/gfx/skia_util.h" |
| 19 #include "ui/views/background.h" | 19 #include "ui/views/background.h" |
| 20 #include "ui/views/border.h" | 20 #include "ui/views/border.h" |
| 21 #include "ui/views/controls/scroll_view.h" | 21 #include "ui/views/controls/scroll_view.h" |
| 22 #include "ui/views/controls/textfield/textfield.h" | 22 #include "ui/views/controls/textfield/textfield.h" |
| 23 #include "ui/views/controls/tree/tree_view_controller.h" | 23 #include "ui/views/controls/tree/tree_view_controller.h" |
| 24 | 24 |
| 25 using ui::TreeModel; | 25 using ui::TreeModel; |
| 26 using ui::TreeModelNode; | 26 using ui::TreeModelNode; |
| 27 | 27 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (focus_manager_) { | 74 if (focus_manager_) { |
| 75 focus_manager_->RemoveFocusChangeListener(this); | 75 focus_manager_->RemoveFocusChangeListener(this); |
| 76 focus_manager_ = NULL; | 76 focus_manager_ = NULL; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 View* TreeView::CreateParentIfNecessary() { | 80 View* TreeView::CreateParentIfNecessary() { |
| 81 ScrollView* scroll_view = new ScrollView; | 81 ScrollView* scroll_view = new ScrollView; |
| 82 scroll_view->SetContents(this); | 82 scroll_view->SetContents(this); |
| 83 scroll_view->set_border(Border::CreateSolidBorder( | 83 scroll_view->set_border(Border::CreateSolidBorder( |
| 84 1, ui::NativeTheme::instance()->GetSystemColor( | 84 1, gfx::NativeTheme::instance()->GetSystemColor( |
| 85 ui::NativeTheme::kColorId_UnfocusedBorderColor))); | 85 gfx::NativeTheme::kColorId_UnfocusedBorderColor))); |
| 86 return scroll_view; | 86 return scroll_view; |
| 87 } | 87 } |
| 88 | 88 |
| 89 void TreeView::SetModel(TreeModel* model) { | 89 void TreeView::SetModel(TreeModel* model) { |
| 90 if (model == model_) | 90 if (model == model_) |
| 91 return; | 91 return; |
| 92 if (model_) | 92 if (model_) |
| 93 model_->RemoveObserver(this); | 93 model_->RemoveObserver(this); |
| 94 | 94 |
| 95 CancelEdit(); | 95 CancelEdit(); |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 if (!is_expanded_) | 901 if (!is_expanded_) |
| 902 return max_width; | 902 return max_width; |
| 903 for (int i = 0; i < child_count(); ++i) { | 903 for (int i = 0; i < child_count(); ++i) { |
| 904 max_width = std::max(max_width, | 904 max_width = std::max(max_width, |
| 905 GetChild(i)->GetMaxWidth(indent, depth + 1)); | 905 GetChild(i)->GetMaxWidth(indent, depth + 1)); |
| 906 } | 906 } |
| 907 return max_width; | 907 return max_width; |
| 908 } | 908 } |
| 909 | 909 |
| 910 } // namespace views | 910 } // namespace views |
| OLD | NEW |