• James Cook's avatar
    cros: Fix crash when using screen casting extension · e8e14cfc
    James Cook authored
    In crrev.com/547515 I removed this block of code from
    ChromeViewsDelegate::CreateNativeWidget:
    
      if (params->context)
        params->context = params->context->GetRootWindow();
    
    The Screencastify extension uses DesktopMediaPickerDialogView, which
    apparently supplies a context window with no parent. We were relying
    on the code above to make params->context null so it would trigger a
    fallback code path.
    
    It's not clear why that code was added in the first place. It
    appeared in https://crrev.com/230793 as part of a revert of some
    RLZ refactoring. However, we depend on the code now, and I cannot
    guarantee that all browser code supplies a context with a valid
    root window, so put it back.
    
    TBR=oshima@chromium.org
    
    Bug: 828626, 311339
    Test: none
    Change-Id: I70b9a884fdf471d34d626237b72b92325cba5df8
    Reviewed-on: https://chromium-review.googlesource.com/994461Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
    Commit-Queue: James Cook <jamescook@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#547978}
    e8e14cfc
chrome_views_delegate_chromeos.cc 3.6 KB