• Guido Urdaneta's avatar
    [Screen Capture] Update heuristic to determine system permission in Catalina · 15fd27f4
    Guido Urdaneta authored
    The old heuristic checked that the title of all windows was readable, but
    it failed in some corner cases where an application creates a window whose
    title cannot be read even with screen capture permissions.
    The new heuristic checks that the title of at least one normal, dock or status
    window running on another process is readable, which is less susceptible to
    failures.
    
    Drive-by: return SYSTEM_PERMISSION_DENIED instead of PERMISSION_DENIED when
    the system permission check fails in getDisplayMedia().
    
    Bug: 993692
    Change-Id: Ie127d1e2d6bd29dd8885b0c461bdab838559fcb8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871885
    Commit-Queue: Guido Urdaneta <guidou@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#708260}
    15fd27f4
display_media_access_handler.cc 10.5 KB