| 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 #ifndef UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
| 6 #define UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 6 #define UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Maps a node to a row, returns -1 if node is not valid. | 117 // Maps a node to a row, returns -1 if node is not valid. |
| 118 int GetRowForNode(ui::TreeModelNode* node); | 118 int GetRowForNode(ui::TreeModelNode* node); |
| 119 | 119 |
| 120 views::Textfield* editor() { return editor_; } | 120 views::Textfield* editor() { return editor_; } |
| 121 | 121 |
| 122 // View overrides: | 122 // View overrides: |
| 123 void Layout() override; | 123 void Layout() override; |
| 124 gfx::Size GetPreferredSize() const override; | 124 gfx::Size GetPreferredSize() const override; |
| 125 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 125 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 126 bool OnMousePressed(const ui::MouseEvent& event) override; | 126 bool OnMousePressed(const ui::MouseEvent& event) override; |
| 127 ui::TextInputClient* GetTextInputClient() override; | |
| 128 void OnGestureEvent(ui::GestureEvent* event) override; | 127 void OnGestureEvent(ui::GestureEvent* event) override; |
| 129 void ShowContextMenu(const gfx::Point& p, | 128 void ShowContextMenu(const gfx::Point& p, |
| 130 ui::MenuSourceType source_type) override; | 129 ui::MenuSourceType source_type) override; |
| 131 void GetAccessibleState(ui::AXViewState* state) override; | 130 void GetAccessibleState(ui::AXViewState* state) override; |
| 132 const char* GetClassName() const override; | 131 const char* GetClassName() const override; |
| 133 | 132 |
| 134 // TreeModelObserver overrides: | 133 // TreeModelObserver overrides: |
| 135 void TreeNodesAdded(ui::TreeModel* model, | 134 void TreeNodesAdded(ui::TreeModel* model, |
| 136 ui::TreeModelNode* parent, | 135 ui::TreeModelNode* parent, |
| 137 int start, | 136 int start, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 void CollapseOrSelectParent(); | 322 void CollapseOrSelectParent(); |
| 324 | 323 |
| 325 // If the selected node is collapsed, it's expanded. Otherwise the first child | 324 // If the selected node is collapsed, it's expanded. Otherwise the first child |
| 326 // is seleected. | 325 // is seleected. |
| 327 void ExpandOrSelectChild(); | 326 void ExpandOrSelectChild(); |
| 328 | 327 |
| 329 // Implementation of Expand(). Returns true if at least one node was expanded | 328 // Implementation of Expand(). Returns true if at least one node was expanded |
| 330 // that previously wasn't. | 329 // that previously wasn't. |
| 331 bool ExpandImpl(ui::TreeModelNode* model_node); | 330 bool ExpandImpl(ui::TreeModelNode* model_node); |
| 332 | 331 |
| 332 PrefixSelector* GetPrefixSelector(); |
| 333 |
| 333 // The model, may be null. | 334 // The model, may be null. |
| 334 ui::TreeModel* model_; | 335 ui::TreeModel* model_; |
| 335 | 336 |
| 336 // Default icons for closed/open. | 337 // Default icons for closed/open. |
| 337 gfx::ImageSkia closed_icon_; | 338 gfx::ImageSkia closed_icon_; |
| 338 gfx::ImageSkia open_icon_; | 339 gfx::ImageSkia open_icon_; |
| 339 | 340 |
| 340 // Icons from the model. | 341 // Icons from the model. |
| 341 std::vector<gfx::ImageSkia> icons_; | 342 std::vector<gfx::ImageSkia> icons_; |
| 342 | 343 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 int text_offset_; | 387 int text_offset_; |
| 387 | 388 |
| 388 scoped_ptr<PrefixSelector> selector_; | 389 scoped_ptr<PrefixSelector> selector_; |
| 389 | 390 |
| 390 DISALLOW_COPY_AND_ASSIGN(TreeView); | 391 DISALLOW_COPY_AND_ASSIGN(TreeView); |
| 391 }; | 392 }; |
| 392 | 393 |
| 393 } // namespace views | 394 } // namespace views |
| 394 | 395 |
| 395 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 396 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
| OLD | NEW |