• Evan Stade's avatar
    WebLayer: hook up MediaSession. · 6cbf85b9
    Evan Stade authored
    This adds the glue code for MediaSession to work in WebLayer.
    
    A new Service class is required in the client library to display
    the notification. This service proxies lifetime events to WebLayer
    implementation, which then glues together componentized code.
    
    Of note:
    1. notifications displayed with Service#startForeground cannot have
       a tag, so the ID must be unique across all application notifications.
       There's a default ID for the MediaSession notification, but an API
       is also added to WebLayer to allow setting a different ID, in case
       this one conflicts.
    2. favicons are not supported (normally they'd be used as fallbacks for
       iconography/images not provided by the system)
    3. Extra handling is required for the action button icons to work,
       see WebLayerNotificationBuilder. On L, we fall back to system icons,
       which look bad because of their low resolution, but are at least
       functional.
    
          https://googlechrome.github.io/samples/media-session/
    
    Test: automated tests TODO; manual testing on
    Bug: 1066263
    Change-Id: I5e2ae13a07315e73aae474251cb5c0424804a427
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220551Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Reviewed-by: default avatarClark DuVall <cduvall@chromium.org>
    Commit-Queue: Evan Stade <estade@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#782054}
    6cbf85b9
content_main_delegate_impl.cc 14.1 KB