• Brett Wilson's avatar
    Improve API and documentation of tree models. · 05c9388c
    Brett Wilson authored
    Converts TreeNodeModel to allow an index-based removal for cases where
    an index is known. This prevents a linear search in that case. A
    pass-through function is provided that does the search if the index is
    not known.
    
    This requires a similar change in TreeNode. TreeNode::Add and ::Remove
    used to be virtual but these were never overridden. They are changed
    to non-virtual member functions.
    
    Additional documentation is added referencing TreeNodeModel from TreeModel, and
    some additional examples are provided.
    
    Change-Id: I5c062420bada437f1ef127ce80518e37f5c2aaae
    Reviewed-on: https://chromium-review.googlesource.com/820671
    Commit-Queue: Brett Wilson <brettw@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#523591}
    05c9388c
tree_view.cc 35.8 KB