Chromium Code Reviews| 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. |
|
tapted
2016/06/15 03:17:50
nit: update comment
Elly Fong-Jones
2016/06/16 14:42:34
Done.
| |
| 298 gfx::Rect GetBoundsForNode(InternalNode* node); | 301 gfx::Rect GetTextBoundsForNode(InternalNode* node); |
| 299 | 302 |
| 300 // Implementation of GetBoundsForNode. Separated out as some callers already | 303 // Implementation of GetBoundsForNode. Separated out as some callers already |
|
tapted
2016/06/15 03:17:50
nit: update comment
Elly Fong-Jones
2016/06/16 14:42:34
Done.
| |
| 301 // know the row/depth. | 304 // know the row/depth. |
| 302 gfx::Rect GetBoundsForNodeImpl(InternalNode* node, int row, int depth); | 305 gfx::Rect GetTextBoundsForNodeImpl(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 |
| 307 // Returns the row and depth of the specified node. | 310 // Returns the row and depth of the specified node. |
| 308 InternalNode* GetNodeByRow(int row, int* depth); | 311 InternalNode* GetNodeByRow(int row, int* depth); |
| 309 | 312 |
| 310 // Implementation of GetNodeByRow. |curent_row| is updated as we iterate. | 313 // Implementation of GetNodeByRow. |curent_row| is updated as we iterate. |
| 311 InternalNode* GetNodeByRowImpl(InternalNode* node, | 314 InternalNode* GetNodeByRowImpl(InternalNode* node, |
| 312 int target_row, | 315 int target_row, |
| (...skipping 11 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 | |
|
tapted
2016/06/15 03:17:50
nit: remove "This function" / "this function".
Elly Fong-Jones
2016/06/16 14:42:34
Done.
| |
| 338 // node lies under |point|, this function returns nullptr. | |
| 339 InternalNode* NodeAtPoint(const gfx::Point& point); | |
| 340 | |
| 341 // This function returns whether |point| is in the bounds of |node|'s | |
|
tapted
2016/06/15 03:17:50
nit: Returns whether..
Elly Fong-Jones
2016/06/16 14:42:34
Done.
| |
| 342 // expand/collapse arrow. | |
| 343 bool HitsNodeArrow(InternalNode* node, const gfx::Point& point); | |
| 344 | |
| 334 // The model, may be null. | 345 // The model, may be null. |
| 335 ui::TreeModel* model_; | 346 ui::TreeModel* model_; |
| 336 | 347 |
| 337 // Default icons for closed/open. | 348 // Default icons for closed/open. |
| 338 gfx::ImageSkia closed_icon_; | 349 gfx::ImageSkia closed_icon_; |
| 339 gfx::ImageSkia open_icon_; | 350 gfx::ImageSkia open_icon_; |
| 340 | 351 |
| 341 // Icons from the model. | 352 // Icons from the model. |
| 342 std::vector<gfx::ImageSkia> icons_; | 353 std::vector<gfx::ImageSkia> icons_; |
| 343 | 354 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 387 int text_offset_; | 398 int text_offset_; |
| 388 | 399 |
| 389 std::unique_ptr<PrefixSelector> selector_; | 400 std::unique_ptr<PrefixSelector> selector_; |
| 390 | 401 |
| 391 DISALLOW_COPY_AND_ASSIGN(TreeView); | 402 DISALLOW_COPY_AND_ASSIGN(TreeView); |
| 392 }; | 403 }; |
| 393 | 404 |
| 394 } // namespace views | 405 } // namespace views |
| 395 | 406 |
| 396 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ | 407 #endif // UI_VIEWS_CONTROLS_TREE_TREE_VIEW_VIEWS_H_ |
| OLD | NEW |