Skip to content

Commit

Permalink
Fix a DCHECK failure by registering a handler for 'dialogClose' message.
Browse files Browse the repository at this point in the history
This fixes a DCHECK failure on chrome://print, where no handler was
registered to handle chrome.send("dialogClose").

BUG=416783

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

Cr-Commit-Position: refs/heads/master@{#297199}
  • Loading branch information
sudarsana.nagineni authored and Commit bot committed Sep 29, 2014
1 parent a12fd96 commit 60d2c27
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions chrome/browser/ui/webui/constrained_web_dialog_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ ConstrainedWebDialogUI::~ConstrainedWebDialogUI() {

void ConstrainedWebDialogUI::RenderViewCreated(
RenderViewHost* render_view_host) {
// Add a "dialogClose" callback which matches WebDialogUI behavior.
web_ui()->RegisterMessageCallback("dialogClose",
base::Bind(&ConstrainedWebDialogUI::OnDialogCloseMessage,
base::Unretained(this)));

ConstrainedWebDialogDelegate* delegate = GetConstrainedDelegate();
if (!delegate)
return;
Expand All @@ -74,11 +79,6 @@ void ConstrainedWebDialogUI::RenderViewCreated(
web_ui()->AddMessageHandler(*it);
}

// Add a "dialogClose" callback which matches WebDialogUI behavior.
web_ui()->RegisterMessageCallback("dialogClose",
base::Bind(&ConstrainedWebDialogUI::OnDialogCloseMessage,
base::Unretained(this)));

dialog_delegate->OnDialogShown(web_ui(), render_view_host);
}

Expand Down

0 comments on commit 60d2c27

Please sign in to comment.