Split GetFirstFocusableView() into two pieces and eliminate magic -1.

This is clearer to understand and facilitates later conversion to iterators.  It
also makes it more possible to change forward and backward searching to behave
distinctly, which we may want to fix bug 942358.

This makes one behavior change: GetNextFocusedView(.., false) will now be
willing to return parent views where the child was the first child.  This is
symmetric with the "forward" behavior, makes more sense in the abstract, and I
believe was simply an artifact of the original code trying to avoid overloading
the meaning of "-1" (which would have meant "check all children" when this
callsite meant "check no children").  I did not think deeply through how this
change would affect callers in practice.

Bug: 942358
Change-Id: Ie25208878db4e61dea2b39c6628575959c037544
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525159
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641490}
1 file changed