summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 20:20:45 +0000
committerjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 20:20:45 +0000
commit7a43e6c7d0c5bdecf43f3d5d4ad286ae890bf230 (patch)
tree442c450e1969d6f90084574be04611c2b3295a9f /chrome
parentd422c691f9c9ebf6d0df001fe29cd79cd46645bb (diff)
downloadchromium_src-7a43e6c7d0c5bdecf43f3d5d4ad286ae890bf230.zip
chromium_src-7a43e6c7d0c5bdecf43f3d5d4ad286ae890bf230.tar.gz
chromium_src-7a43e6c7d0c5bdecf43f3d5d4ad286ae890bf230.tar.bz2
Fix the issue that HtmlDialogView does not handle keyboard event on aura.
BUG=110606 TEST=Print dialog should be closed by Esc key after it gets focus on web UI. Review URL: http://codereview.chromium.org/9252028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/ui/views/html_dialog_view.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/html_dialog_view.cc b/chrome/browser/ui/views/html_dialog_view.cc
index abe5c86..d5d2a73 100644
--- a/chrome/browser/ui/views/html_dialog_view.cc
+++ b/chrome/browser/ui/views/html_dialog_view.cc
@@ -25,6 +25,11 @@
#include "ui/views/widget/native_widget_gtk.h"
#endif
+#if defined(USE_AURA)
+#include "ui/aura/event.h"
+#include "ui/views/widget/native_widget_aura.h"
+#endif
+
class RenderWidgetHost;
using content::WebContents;
@@ -222,7 +227,10 @@ void HtmlDialogView::MoveContents(WebContents* source, const gfx::Rect& pos) {
// they're all browser-specific. (This may change in the future.)
void HtmlDialogView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
#if defined(USE_AURA)
- // TODO(saintlou): Need to provide some Aura handling.
+ aura::KeyEvent aura_event(event.os_event->native_event(), false);
+ views::NativeWidgetAura* aura_widget =
+ static_cast<views::NativeWidgetAura*>(GetWidget()->native_widget());
+ aura_widget->OnKeyEvent(&aura_event);
#elif defined(OS_WIN)
// Any unhandled keyboard/character messages should be defproced.
// This allows stuff like F10, etc to work correctly.