Chromium Code Reviews| Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
| diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
| index a56deb7fc9f851beedb554a21c8019a0eee2599a..ba6ea0ac1bf23ea3d39e03d53bf6db9a1f4ea809 100644 |
| --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
| +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
| @@ -28,6 +28,7 @@ |
| #include "ui/events/devices/x11/device_list_cache_x11.h" |
| #include "ui/events/devices/x11/touch_factory_x11.h" |
| #include "ui/events/event_utils.h" |
| +#include "ui/events/null_event_targeter.h" |
| #include "ui/events/platform/platform_event_source.h" |
| #include "ui/events/platform/x11/x11_event_source.h" |
| #include "ui/gfx/display.h" |
| @@ -171,6 +172,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( |
| window_parent_(NULL), |
| custom_window_shape_(false), |
| urgency_hint_set_(false), |
| + modal_dialog_xid_(0), |
| close_widget_factory_(this) { |
| } |
| @@ -2033,6 +2035,25 @@ gfx::Rect DesktopWindowTreeHostX11::ToPixelRect( |
| return gfx::ToEnclosingRect(rect_in_pixels); |
| } |
| +const XID DesktopWindowTreeHostX11::GetModalDialog() { |
| + return modal_dialog_xid_; |
| +} |
| + |
| +void DesktopWindowTreeHostX11::DisableEventListening(XID dialog) { |
| + DCHECK(!modal_dialog_xid_); |
|
joone
2015/07/17 18:14:59
The modal_dialog_xid_ should be null so this line
sadrul
2015/07/19 01:25:36
Sorry I missed this during review. Looks like some
|
| + modal_dialog_xid_ = dialog; |
|
sadrul
2015/07/19 01:25:36
Add a DCHECK that |dialog| is non-zero too?
joone
2015/07/20 19:28:37
I will add a DECHECK.
|
| + // ScopedWindowTargeter is used to temporarily replace the event-targeter |
| + // with NullEventTargeter to make |dialog| modal. |
| + targeter_for_modal_.reset(new aura::ScopedWindowTargeter(window(), |
| + scoped_ptr<ui::EventTargeter>(new ui::NullEventTargeter))); |
| +} |
| + |
| +void DesktopWindowTreeHostX11::EnableEventListening() { |
| + DCHECK(modal_dialog_xid_); |
|
joone
2015/07/17 18:14:59
modal_dialog_xid_ should be not null so it was cha
|
| + modal_dialog_xid_ = 0; |
| + targeter_for_modal_.reset(); |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // DesktopWindowTreeHost, public: |