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

Side by Side 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: Reverted CL Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <X11/extensions/shape.h> 10 #include <X11/extensions/shape.h>
11 #include <X11/Xlib.h> 11 #include <X11/Xlib.h>
12 #include <X11/Xutil.h> 12 #include <X11/Xutil.h>
13 13
14 #include "base/cancelable_callback.h" 14 #include "base/cancelable_callback.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "base/observer_list.h" 17 #include "base/observer_list.h"
18 #include "ui/aura/scoped_window_targeter.h"
18 #include "ui/aura/window_tree_host.h" 19 #include "ui/aura/window_tree_host.h"
19 #include "ui/base/cursor/cursor_loader_x11.h" 20 #include "ui/base/cursor/cursor_loader_x11.h"
20 #include "ui/events/platform/platform_event_dispatcher.h" 21 #include "ui/events/platform/platform_event_dispatcher.h"
21 #include "ui/gfx/geometry/insets.h" 22 #include "ui/gfx/geometry/insets.h"
22 #include "ui/gfx/geometry/rect.h" 23 #include "ui/gfx/geometry/rect.h"
23 #include "ui/gfx/geometry/size.h" 24 #include "ui/gfx/geometry/size.h"
24 #include "ui/gfx/x/x11_atom_cache.h" 25 #include "ui/gfx/x/x11_atom_cache.h"
25 #include "ui/views/views_export.h" 26 #include "ui/views/views_export.h"
26 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" 27 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h"
27 28
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void AddObserver(views::DesktopWindowTreeHostObserverX11* observer); 81 void AddObserver(views::DesktopWindowTreeHostObserverX11* observer);
81 void RemoveObserver(views::DesktopWindowTreeHostObserverX11* observer); 82 void RemoveObserver(views::DesktopWindowTreeHostObserverX11* observer);
82 83
83 // Swaps the current handler for events in the non client view with |handler|. 84 // Swaps the current handler for events in the non client view with |handler|.
84 void SwapNonClientEventHandler(scoped_ptr<ui::EventHandler> handler); 85 void SwapNonClientEventHandler(scoped_ptr<ui::EventHandler> handler);
85 86
86 // Runs the |func| callback for each content-window, and deallocates the 87 // Runs the |func| callback for each content-window, and deallocates the
87 // internal list of open windows. 88 // internal list of open windows.
88 static void CleanUpWindowList(void (*func)(aura::Window* window)); 89 static void CleanUpWindowList(void (*func)(aura::Window* window));
89 90
91 // Disables event listening to make |dialog| modal.
92 void DisableEventListening(XID dialog);
93
94 // Enables event listening after closing |dialog|.
95 void EnableEventListening();
96
97 // Returns XID of dialog currently displayed. When it returns 0,
98 // there is no dialog on the host window.
99 const XID GetModalDialog();
100
90 protected: 101 protected:
91 // Overridden from DesktopWindowTreeHost: 102 // Overridden from DesktopWindowTreeHost:
92 void Init(aura::Window* content_window, 103 void Init(aura::Window* content_window,
93 const Widget::InitParams& params) override; 104 const Widget::InitParams& params) override;
94 void OnNativeWidgetCreated(const Widget::InitParams& params) override; 105 void OnNativeWidgetCreated(const Widget::InitParams& params) override;
95 scoped_ptr<corewm::Tooltip> CreateTooltip() override; 106 scoped_ptr<corewm::Tooltip> CreateTooltip() override;
96 scoped_ptr<aura::client::DragDropClient> CreateDragDropClient( 107 scoped_ptr<aura::client::DragDropClient> CreateDragDropClient(
97 DesktopNativeCursorManager* cursor_manager) override; 108 DesktopNativeCursorManager* cursor_manager) override;
98 void Close() override; 109 void Close() override;
99 void CloseNow() override; 110 void CloseNow() override;
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // Whether we currently are flashing our frame. This feature is implemented 353 // Whether we currently are flashing our frame. This feature is implemented
343 // by setting the urgency hint with the window manager, which can draw 354 // by setting the urgency hint with the window manager, which can draw
344 // attention to the window or completely ignore the hint. We stop flashing 355 // attention to the window or completely ignore the hint. We stop flashing
345 // the frame when |xwindow_| gains focus or handles a mouse button event. 356 // the frame when |xwindow_| gains focus or handles a mouse button event.
346 bool urgency_hint_set_; 357 bool urgency_hint_set_;
347 358
348 bool activatable_; 359 bool activatable_;
349 360
350 base::CancelableCallback<void()> delayed_resize_task_; 361 base::CancelableCallback<void()> delayed_resize_task_;
351 362
363 scoped_ptr<aura::ScopedWindowTargeter> targeter_for_modal_;
364
365 XID modal_dialog_xid_;
366
352 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; 367 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
353 368
354 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); 369 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
355 }; 370 };
356 371
357 } // namespace views 372 } // namespace views
358 373
359 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ 374 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698