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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h

Issue 1624793002: Make File-Picker modal on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a WeakPtrFactory Created 4 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
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
index 07e35cabb1abd6d4bfac08a3b561311d1aa6a4b6..2e026c42d6656558bf752acb194ffa8c73c7cb45 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "ui/aura/scoped_window_targeter.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/cursor/cursor_loader_x11.h"
#include "ui/events/platform/platform_event_dispatcher.h"
@@ -51,6 +52,16 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
DesktopNativeWidgetAura* desktop_native_widget_aura);
~DesktopWindowTreeHostX11() override;
+ class ScopedHandle {
+ public:
+ explicit ScopedHandle(const base::Closure& destroy_callback);
+ ~ScopedHandle();
+
+ private:
+ base::Closure destroy_callback_;
+ DISALLOW_COPY_AND_ASSIGN(ScopedHandle);
+ };
+
// A way of converting an X11 |xid| host window into a |content_window_|.
static aura::Window* GetContentWindowForXID(XID xid);
@@ -83,6 +94,13 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// internal list of open windows.
static void CleanUpWindowList(void (*func)(aura::Window* window));
+ // Disables event listening to make |dialog| modal.
+ std::unique_ptr<ScopedHandle> DisableEventListening(XID dialog);
+
+ // Returns XID of dialog currently displayed. When it returns 0,
+ // there is no dialog on the host window.
+ XID GetModalDialog();
+
protected:
// Overridden from DesktopWindowTreeHost:
void Init(aura::Window* content_window,
@@ -266,6 +284,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
gfx::Rect ToDIPRect(const gfx::Rect& rect_in_pixels) const;
gfx::Rect ToPixelRect(const gfx::Rect& rect_in_dip) const;
+ // Enables event listening after closing |dialog|.
+ void EnableEventListening();
+
// X11 things
// The display and the native X window hosting the root window.
XDisplay* xdisplay_;
@@ -412,7 +433,14 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
base::CancelableCallback<void()> delayed_resize_task_;
+ std::unique_ptr<aura::ScopedWindowTargeter> targeter_for_modal_;
+
+ XID modal_dialog_xid_;
+
+ ScopedHandle* scoped_handle_;
sadrul 2016/09/30 12:22:27 You shouldn't need this?
joone 2016/10/01 00:03:16 Removed.
+
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
+ base::WeakPtrFactory<DesktopWindowTreeHostX11> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
};

Powered by Google App Engine
This is Rietveld 408576698