| Index: ui/views/controls/webview/web_dialog_view.cc
|
| diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc
|
| index 81e1882f67fe0d694f37fa2c30a1c53b60a69f14..b0795b10de10e10fa467843fd8ae119acb1a8156 100644
|
| --- a/ui/views/controls/webview/web_dialog_view.cc
|
| +++ b/ui/views/controls/webview/web_dialog_view.cc
|
| @@ -54,6 +54,12 @@ WebDialogView::WebDialogView(
|
| SetLayoutManager(new views::FillLayout);
|
| // Pressing the ESC key will close the dialog.
|
| AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
|
| +
|
| + // For Chrome OS/CFM, Shift + Browser Back is mapped to hangup button, which
|
| + // can be used to close the web dialog.
|
| + ui::Accelerator shift_browser_back(ui::VKEY_BROWSER_BACK, ui::EF_SHIFT_DOWN);
|
| + if (AdditionalAccelerator(shift_browser_back))
|
| + AddAccelerator(shift_browser_back);
|
| }
|
|
|
| WebDialogView::~WebDialogView() {
|
| @@ -81,8 +87,8 @@ gfx::Size WebDialogView::GetMinimumSize() const {
|
| }
|
|
|
| bool WebDialogView::AcceleratorPressed(const ui::Accelerator& accelerator) {
|
| - // Pressing ESC closes the dialog.
|
| - DCHECK_EQ(ui::VKEY_ESCAPE, accelerator.key_code());
|
| + DCHECK(ui::VKEY_ESCAPE == accelerator.key_code() ||
|
| + AdditionalAccelerator(accelerator));
|
| if (GetWidget())
|
| GetWidget()->Close();
|
| return true;
|
| @@ -265,6 +271,13 @@ bool WebDialogView::HandleContextMenu(
|
| return WebDialogWebContentsDelegate::HandleContextMenu(params);
|
| }
|
|
|
| +bool WebDialogView::AdditionalAccelerator(
|
| + const ui::Accelerator& accelerator) const {
|
| + if (delegate_)
|
| + return delegate_->AdditionalAccelerator(accelerator);
|
| + return false;
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // content::WebContentsDelegate implementation:
|
|
|
|
|