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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 25445002: Ensure that in Desktop AURA the WindowModalityController class is at the head of the event pre targ… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | « ui/views/widget/desktop_aura/desktop_native_widget_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
===================================================================
--- ui/views/widget/desktop_aura/desktop_native_widget_aura.cc (revision 226057)
+++ ui/views/widget/desktop_aura/desktop_native_widget_aura.cc (working copy)
@@ -185,7 +185,8 @@
native_widget_delegate_(delegate),
last_drop_operation_(ui::DragDropTypes::DRAG_NONE),
restore_focus_on_activate_(false),
- cursor_(gfx::kNullCursor) {
+ cursor_(gfx::kNullCursor),
+ widget_type_(Widget::InitParams::TYPE_WINDOW) {
window_->SetProperty(kDesktopNativeWidgetAuraKey, this);
aura::client::SetFocusChangeObserver(window_, this);
aura::client::SetActivationChangeObserver(window_, this);
@@ -246,6 +247,15 @@
aura::RootWindow* root) {
DCHECK(!input_method_event_filter_.get());
+ // The WindowsModalityController event filter should be at the head of the
+ // pre target handlers list. This ensures that it handles input events first
+ // when modal windows are at the top of the Zorder.
+ if (widget_type_ == Widget::InitParams::TYPE_WINDOW) {
+ window_modality_controller_.reset(
+ new views::corewm::WindowModalityController);
+ root->AddPreTargetHandler(window_modality_controller_.get());
+ }
+
// CEF sets focus to the window the user clicks down on.
// TODO(beng): see if we can't do this some other way. CEF seems a heavy-
// handed way of accomplishing focus.
@@ -302,6 +312,7 @@
void DesktopNativeWidgetAura::InitNativeWidget(
const Widget::InitParams& params) {
ownership_ = params.ownership;
+ widget_type_ = params.type;
NativeWidgetAura::RegisterNativeWidgetForWindow(this, window_);
// Animations on TYPE_WINDOW are handled by the OS. Additionally if we animate
@@ -354,12 +365,6 @@
GetNativeView()->GetRootWindow());
}
- if (params.type == Widget::InitParams::TYPE_WINDOW) {
- window_modality_controller_.reset(
- new views::corewm::WindowModalityController);
- root_window_->AddPreTargetHandler(window_modality_controller_.get());
- }
-
window_->Show();
desktop_root_window_host_->InitFocus(window_);
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698