Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: chrome/browser/views/html_dialog_view.cc

Issue 199069: Added an event handler to the GAIA login page which closes the dialog when it... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/html_dialog_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/html_dialog_view.cc
===================================================================
--- chrome/browser/views/html_dialog_view.cc (revision 27254)
+++ chrome/browser/views/html_dialog_view.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/browser/views/html_dialog_view.h"
+#include "base/keyboard_codes.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "views/widget/root_view.h"
@@ -48,6 +49,13 @@
return out;
}
+bool HtmlDialogView::AcceleratorPressed(const views::Accelerator& accelerator) {
+ // Pressing ESC closes the dialog.
+ DCHECK_EQ(base::VKEY_ESCAPE, accelerator.GetKeyCode());
+ OnDialogClosed(std::string());
+ return true;
+}
+
////////////////////////////////////////////////////////////////////////////////
// HtmlDialogView, views::WindowDelegate implementation:
@@ -216,5 +224,8 @@
HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(),
this);
+ // Pressing the ESC key will close the dialog.
+ AddAccelerator(views::Accelerator(base::VKEY_ESCAPE, false, false, false));
+
DOMView::LoadURL(delegate_->GetDialogContentURL());
}
« no previous file with comments | « chrome/browser/views/html_dialog_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698