• Toni Barzic's avatar
    Improve shelf widget delegate layout · 04b6f304
    Toni Barzic authored
    The shelf widget delegate view, which also acts as a shelf widget's
    contents view, contains two views - login shelf view, and the drag
    handle.
    
    Currently it uses fill layout manager for layout, which makes sense for
    login shelf view, but not so much for the drag handle. To avoid drag
    handle from getting resized to the whole shelf view bounds, the shelf
    widget resets the delegate view layout manager when session state
    changes. This works because login shelf and drag handle are mutually
    exclusive. With new final first user run oobe screen mocks, which may
    have swipe from shelf gesture enabled, login shelf may require drag
    handle, which now break with fill layout manager.
    
    This CL changes shelf widget delegate view to manage its own layout - it
    sets the login shelf view to full shelf bounds, and centers the drag
    handle within the shelf bounds. Also, it makes relationship between
    delegate view and login shelf view more explicit, as the login view is
    now added to delegate view using explicit AddLoginShelfView method,
    instead of using GetContentsView()->AddChildView from shelf widget.
    
    BUG=976949
    
    Change-Id: Ic5a26c4ab657194c4cf4dfc5a4473eca4807146e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2071289
    Commit-Queue: Toni Baržić <tbarzic@chromium.org>
    Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#744353}
    04b6f304
shelf_widget.cc 34.3 KB