• Tibor Goldschwendt's avatar
    [webui][ntp] Support interactive doodles on themed NTPs · ec33de8d
    Tibor Goldschwendt authored
    Adds feature flag WebUIThemeModeDoodles, which enables showing Doodles
    on themed and dark mode NTPs. Furthermore, this CLs implements the dark
    mode change protocol for interactive doodles. The protocol looks as
    follows:
    
    1. Append theme_messages=0 to the doodle URL. This tells the doodle that
       the mode change messaging protocol with version 0 is enabled.
    
    2. Every time the mode changes postMessage
       {
         cmd: 'changeMode',
         dark: true|false,
       }
       to the doodle.
    
    3. If the doodle postMessages
       {
         cmd: 'sendMode',
       }
       respond with the postMessage from 2. above. This is to work around
       a race condition where the NTP could postMessage the mode before the
       doodle has installed a message listener.
    
    Bug: 688960
    Change-Id: Icc1e333f33fd1f01a2c8d1d4a581fdf360ca7090
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2253220
    Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
    Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
    Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#780392}
    ec33de8d
ntp_features.h 1.35 KB