[NTP Client] Split TreeNode#init into SetParent and SetChildren
Unties Node construction with the initialisation of their parent and children. This allows controlling when the notifications about child modifications are propagated, and simplifies the initialisation order. The InnerNode#setParent() call is now what enables the notifications and is done as the last step of the NewTabPageAdapter constructor. ChildNode and InnerNode share almost all of the logic related to managing the tree and their implementations make use of that without specific modifications. This also fixes some bugs related to resetting the section list. BUG=616090,674023 Review-Url: https://codereview.chromium.org/2573173002 Cr-Commit-Position: refs/heads/master@{#439489}
Showing
Please register or sign in to comment