• Erik Chen's avatar
    lacros: Fix crash when opening chrome://settings · 0e972cf1
    Erik Chen authored
    Lacros uses the chromeOS user-agent string but does not display
    ash-specific settings. Historically, webui relied on the user-agent to
    determine what platform the browser runs on. The combination of the two
    results in webUI settings trying to access ash-only private extension
    APIs, causing a crash.
    
    This CL updates the logic to explicitly check platform via gn args via
    grit, and plumbs through lacros as a new platform.
    
    This CL has one known problem: grit is not processed for js/cr.js for
    some webUI tests. This results on isLacros and isChromeOS returning the
    wrong values. This doesn't seem to affect any tests for now, but this is
    a problem that should be fixed. This is tracked in
    https://crbug.com/1118190.
    
    Bug: 1111985
    Change-Id: I038a533ccbc5018cd125a49e70320a36b5aa4d31
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2360816
    Commit-Queue: Erik Chen <erikchen@chromium.org>
    Reviewed-by: default avatardpapad <dpapad@chromium.org>
    Auto-Submit: Erik Chen <erikchen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#800764}
    0e972cf1
BUILD.gn 2.37 KB