• Peter Beverloo's avatar
    Fix a number of DCHECKs in NotificationHeaderView · 39192057
    Peter Beverloo authored
    The header view includes a number of DCHECKs to verify that the metrics
    of the created layout match the mocks. This is fine, but there's a
    subtlety in the preferred height of views::Label: the text's size is
    determined by using the maximum of the font height and the line height.
    
    The line height is set in Label's constructor based on the text style,
    where it consults the typography provider available from the layout
    provider. There are three versions of this: DefaultTypographyProvider,
    LegacyTypographyProvider and HarmonyTypographyProvider.
    
    The first two return 0, and thereby defer to the font list. The harmony
    provider has a calculation involving platform-specific values. This
    grows the height of the labels, thereby failing the DCHECKs.
    
    Instead, change the labels to always defer to the font list for their
    line height. This removes the platform-specific dependency.
    
    BUG=
    
    Change-Id: I6530b4517bd7bf6ba62f36cd595e05e616b580d4
    Reviewed-on: https://chromium-review.googlesource.com/788957Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
    Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
    Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#519574}
    39192057
notification_header_view.cc 13.6 KB