| 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_);
|
|
|
|
|