Skip to content

Commit

Permalink
[Webview] Handle the case when the embedder WebContents does not have…
Browse files Browse the repository at this point in the history
… a delegate.

BUG=NONE
TEST=Existing unit tests.

Review URL: https://codereview.chromium.org/112073002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240006 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
noms@chromium.org committed Dec 11, 2013
1 parent bfb6f7b commit d131bd5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions content/browser/browser_plugin/browser_plugin_guest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,9 @@ void BrowserPluginGuest::HandleKeyboardEvent(
if (delegate_ && delegate_->HandleKeyboardEvent(event))
return;

if (!embedder_web_contents_->GetDelegate())
return;

// Send the unhandled keyboard events back to the embedder to reprocess them.
// TODO(fsamuel): This introduces the possibility of out-of-order keyboard
// events because the guest may be arbitrarily delayed when responding to
Expand Down Expand Up @@ -831,6 +834,12 @@ void BrowserPluginGuest::RendererResponsive(WebContents* source) {

void BrowserPluginGuest::RunFileChooser(WebContents* web_contents,
const FileChooserParams& params) {
if (!attached())
return;

if (!embedder_web_contents_->GetDelegate())
return;

embedder_web_contents_->GetDelegate()->RunFileChooser(web_contents, params);
}

Expand Down

0 comments on commit d131bd5

Please sign in to comment.