diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 06:25:37 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 06:25:37 +0000 |
commit | 4d9b083160466cee96855a80318a904b7c89eec7 (patch) | |
tree | 55b1b9acc1860f0551751e570993776a6805b9c3 /ui/views/controls/webview/web_dialog_view.cc | |
parent | d5b13808a0a79f898f042f4d224e834d99f8a56a (diff) | |
download | chromium_src-4d9b083160466cee96855a80318a904b7c89eec7.zip chromium_src-4d9b083160466cee96855a80318a904b7c89eec7.tar.gz chromium_src-4d9b083160466cee96855a80318a904b7c89eec7.tar.bz2 |
Add desktop-awareness to ChromeViewsDelegate::OnBeforeWidgetInit when deciding whether to make a window top-level or not.
This replaces an earlier spot-fix in http://crrev.com/197949 to explicitly unparent JS dialogs in aura win and doesn't suffer from bad window placement side-effects.
BUG=181162, 238249
TEST=All desktop aura dialogs are now correctly-placed top-level windows. See crbug.com/181162#c11 for a partial list of such dialogs.
Review URL: https://chromiumcodereview.appspot.com/14678017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls/webview/web_dialog_view.cc')
-rw-r--r-- | ui/views/controls/webview/web_dialog_view.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc index 9ea236a..1517379 100644 --- a/ui/views/controls/webview/web_dialog_view.cc +++ b/ui/views/controls/webview/web_dialog_view.cc @@ -24,6 +24,7 @@ #if defined(USE_AURA) #include "ui/base/events/event.h" +#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" #include "ui/views/widget/native_widget_aura.h" #endif @@ -273,14 +274,18 @@ void WebDialogView::HandleKeyboardEvent(content::WebContents* source, if (!event.os_event) return; ui::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); + ui::EventHandler* event_handler = + GetWidget()->native_widget()->GetEventHandler(); + + DCHECK(event_handler); + if (event_handler) + event_handler->OnKeyEvent(&aura_event); + #elif defined(OS_WIN) // Any unhandled keyboard/character messages should be defproced. // This allows stuff like F10, etc to work correctly. DefWindowProc(event.os_event.hwnd, event.os_event.message, - event.os_event.wParam, event.os_event.lParam); + event.os_event.wParam, event.os_event.lParam); #endif } |