Commit 32cb6996 authored by Jesse Schettler's avatar Jesse Schettler Committed by Commit Bot

GuestViewBase: Null-check before using WebContentsDelegate

WebContents::GetDelegate() can return nullptr when handling a keyboard
event.

BUG=b:64863368
TEST=While browsing a PDF with an ARC Custom Tab, press Ctrl and verify
no crash occurs

Change-Id: I113a41d23f27409d52bcfe313cb4142f7562f905
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645816Reviewed-by: default avatarEhsan Karamad <ekaramad@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666333}
parent 18531423
...@@ -645,7 +645,7 @@ void GuestViewBase::ContentsZoomChange(bool zoom_in) { ...@@ -645,7 +645,7 @@ void GuestViewBase::ContentsZoomChange(bool zoom_in) {
bool GuestViewBase::HandleKeyboardEvent( bool GuestViewBase::HandleKeyboardEvent(
WebContents* source, WebContents* source,
const content::NativeWebKeyboardEvent& event) { const content::NativeWebKeyboardEvent& event) {
if (!attached()) if (!attached() || !embedder_web_contents()->GetDelegate())
return false; return false;
// Send the keyboard events back to the embedder to reprocess them. // Send the keyboard events back to the embedder to reprocess them.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment