| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 void PaintExpandControl(gfx::Canvas* canvas, | 287 void PaintExpandControl(gfx::Canvas* canvas, |
| 288 const gfx::Rect& node_bounds, | 288 const gfx::Rect& node_bounds, |
| 289 bool expanded); | 289 bool expanded); |
| 290 | 290 |
| 291 // Returns the InternalNode for a model node. |create_type| indicates wheter | 291 // Returns the InternalNode for a model node. |create_type| indicates wheter |
| 292 // this should load InternalNode or not. | 292 // this should load InternalNode or not. |
| 293 InternalNode* GetInternalNodeForModelNode( | 293 InternalNode* GetInternalNodeForModelNode( |
| 294 ui::TreeModelNode* model_node, | 294 ui::TreeModelNode* model_node, |
| 295 GetInternalNodeCreateType create_type); | 295 GetInternalNodeCreateType create_type); |
| 296 | 296 |
| 297 // Returns the bounds for a node's background. |
| 298 gfx::Rect GetBackgroundBoundsForNode(InternalNode* node); |
| 299 |
| 297 // Returns the bounds for a node. | 300 // Returns the bounds for a node. |
| 298 gfx::Rect GetBoundsForNode(InternalNode* node); | 301 gfx::Rect GetBoundsForNode(InternalNode* node); |
| 299 | 302 |
| 300 // Implementation of GetBoundsForNode. Separated out as some callers already | 303 // Implementation of GetBoundsForNode. Separated out as some callers already |
| 301 // know the row/depth. | 304 // know the row/depth. |
| 302 gfx::Rect GetBoundsForNodeImpl(InternalNode* node, int row, int depth); | 305 gfx::Rect GetBoundsForNodeImpl(InternalNode* node, int row, int depth); |
| 303 | 306 |
| 304 // Returns the row and depth of a node. | 307 // Returns the row and depth of a node. |
| 305 int GetRowForInternalNode(InternalNode* node, int* depth); | 308 int GetRowForInternalNode(InternalNode* node, int* depth); |
| 306 | 309 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 324 // If the selected node is collapsed, it's expanded. Otherwise the first child | 327 // If the selected node is collapsed, it's expanded. Otherwise the first child |
| 325 // is seleected. | 328 // is seleected. |
| 326 void ExpandOrSelectChild(); | 329 void ExpandOrSelectChild(); |
| 327 | 330 |
| 328 // Implementation of Expand(). Returns true if at least one node was expanded | 331 // Implementation of Expand(). Returns true if at least one node was expanded |
| 329 // that previously wasn't. | 332 // that previously wasn't. |
| 330 bool ExpandImpl(ui::TreeModelNode* model_node); | 333 bool ExpandImpl(ui::TreeModelNode* model_node); |
| 331 | 334 |
| 332 PrefixSelector* GetPrefixSelector(); | 335 PrefixSelector* GetPrefixSelector(); |
| 333 | 336 |
| 337 // This function returns the InternalNode (if any) lying under |point|. If no |
| 338 // node lies under |point|, this function returns nullptr. If a non-null node |
| 339 // is returned, its depth is stored in |*depth|. |
| 340 InternalNode* NodeAtPoint(const gfx::Point& point, int* depth = nullptr); |
| 341 |
| 342 // This function returns whether |point| is in the bounds of |node|'s |
| 343 // expand/collapse arrow, where |node| is at depth |depth|. |
| 344 bool HitsNodeArrow(InternalNode* node, int depth, const gfx::Point& point); |
| 345 |
| 334 // The model, may be null. | 346 // The model, may be null. |
| 335 ui::TreeModel* model_; | 347 ui::TreeModel* model_; |
| 336 | 348 |
| 337 // Default icons for closed/open. | 349 // Default icons for closed/open. |
| 338 gfx::ImageSkia closed_icon_; | 350 gfx::ImageSkia closed_icon_; |
| 339 gfx::ImageSkia open_icon_; | 351 gfx::ImageSkia open_icon_; |
| 340 | 352 |
| 341 // Icons from the model. | 353 // Icons from the model. |
| 342 std::vector<gfx::ImageSkia> icons_; | 354 std::vector<gfx::ImageSkia> icons_; |
| 343 | 355 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 int text_offset_; | 399 int text_offset_; |
| 388 | 400 |
| 389 std::unique_ptr<PrefixSelector> selector_; | 401 std::unique_ptr<PrefixSelector> selector_; |
| 390 | 402 |
| 391 DISALLOW_COPY_AND_ASSIGN(TreeView); | 403 DISALLOW_COPY_AND_ASSIGN(TreeView); |
| 392 }; | 404 }; |
| 393 | 405 |
| 394 } // namespace views | 406 } // namespace views |
| 395 | 407 |
| 396 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 408 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
| OLD | NEW |