• Alex Keng's avatar
    Implement the new look of radio and checkbox and enable bifurcation · adc4f610
    Alex Keng authored
    This CL implements the new look of radio (accent color),
    checkbox (accent color and indeterminate state), range (accent color)
    and also addresses several underlying issues:
    
    1. The drawing code is not ready for dark theme. This is addressed by
    introducing a new set of color ids in NativeThemeAura and using GetControlColor
    instead of color constants to draw controls. This way when the colors for
    dark theme are designed, we can just add new colors to GetControlColor
    and the drawing codes in NativeThemeAura can be left untouched.
    
    2. Downstream needs a way to implement bifurcation of styles and limit
    the merge conflicts. This can also be achieved by redirecting logics
    in NativeThemeAura ::GetControlColor and define new colors in the new code path.
    
    3. Too many duplicated color constants. This is addressed by consolidating
    24 constants into 11 color ids. Ex (kCheckboxAndRadioBorderHoveredColor,
    kInputBorderHoveredColor, and kButtonBorderHoveredColor are mapped to
    kHoveredBorder)
    
    4. The expected files for high contrast tests are prone to have conflicts.
    This is because upstream and downstream use different colors for disabled
    UI so every time upstream file is updated, downstream would need to
    re-baseline. This is addressed by providing default HC color for web tests
    mode, which also make the test results more readable.
    
    
    Bug: 1001546,1001553,1001554,986850
    Change-Id: Icd6c4a0b96dd974b6500ba4365d22435d9e30f82
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792578
    Commit-Queue: Alex Keng <shihken@microsoft.com>
    Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#697463}
    adc4f610
native_theme_base.h 8.32 KB