| OLD | NEW |
| 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" | |
| 19 #include "ui/aura/window_tree_host.h" | 18 #include "ui/aura/window_tree_host.h" |
| 20 #include "ui/base/cursor/cursor_loader_x11.h" | 19 #include "ui/base/cursor/cursor_loader_x11.h" |
| 21 #include "ui/events/platform/platform_event_dispatcher.h" | 20 #include "ui/events/platform/platform_event_dispatcher.h" |
| 22 #include "ui/gfx/geometry/insets.h" | 21 #include "ui/gfx/geometry/insets.h" |
| 23 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| 24 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 25 #include "ui/gfx/x/x11_atom_cache.h" | 24 #include "ui/gfx/x/x11_atom_cache.h" |
| 26 #include "ui/views/views_export.h" | 25 #include "ui/views/views_export.h" |
| 27 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 26 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
| 28 | 27 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void AddObserver(views::DesktopWindowTreeHostObserverX11* observer); | 80 void AddObserver(views::DesktopWindowTreeHostObserverX11* observer); |
| 82 void RemoveObserver(views::DesktopWindowTreeHostObserverX11* observer); | 81 void RemoveObserver(views::DesktopWindowTreeHostObserverX11* observer); |
| 83 | 82 |
| 84 // Swaps the current handler for events in the non client view with |handler|. | 83 // Swaps the current handler for events in the non client view with |handler|. |
| 85 void SwapNonClientEventHandler(scoped_ptr<ui::EventHandler> handler); | 84 void SwapNonClientEventHandler(scoped_ptr<ui::EventHandler> handler); |
| 86 | 85 |
| 87 // Runs the |func| callback for each content-window, and deallocates the | 86 // Runs the |func| callback for each content-window, and deallocates the |
| 88 // internal list of open windows. | 87 // internal list of open windows. |
| 89 static void CleanUpWindowList(void (*func)(aura::Window* window)); | 88 static void CleanUpWindowList(void (*func)(aura::Window* window)); |
| 90 | 89 |
| 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 XID GetModalDialog(); | |
| 100 | |
| 101 protected: | 90 protected: |
| 102 // Overridden from DesktopWindowTreeHost: | 91 // Overridden from DesktopWindowTreeHost: |
| 103 void Init(aura::Window* content_window, | 92 void Init(aura::Window* content_window, |
| 104 const Widget::InitParams& params) override; | 93 const Widget::InitParams& params) override; |
| 105 void OnNativeWidgetCreated(const Widget::InitParams& params) override; | 94 void OnNativeWidgetCreated(const Widget::InitParams& params) override; |
| 106 scoped_ptr<corewm::Tooltip> CreateTooltip() override; | 95 scoped_ptr<corewm::Tooltip> CreateTooltip() override; |
| 107 scoped_ptr<aura::client::DragDropClient> CreateDragDropClient( | 96 scoped_ptr<aura::client::DragDropClient> CreateDragDropClient( |
| 108 DesktopNativeCursorManager* cursor_manager) override; | 97 DesktopNativeCursorManager* cursor_manager) override; |
| 109 void Close() override; | 98 void Close() override; |
| 110 void CloseNow() override; | 99 void CloseNow() override; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 // Whether we currently are flashing our frame. This feature is implemented | 342 // Whether we currently are flashing our frame. This feature is implemented |
| 354 // by setting the urgency hint with the window manager, which can draw | 343 // by setting the urgency hint with the window manager, which can draw |
| 355 // attention to the window or completely ignore the hint. We stop flashing | 344 // attention to the window or completely ignore the hint. We stop flashing |
| 356 // the frame when |xwindow_| gains focus or handles a mouse button event. | 345 // the frame when |xwindow_| gains focus or handles a mouse button event. |
| 357 bool urgency_hint_set_; | 346 bool urgency_hint_set_; |
| 358 | 347 |
| 359 bool activatable_; | 348 bool activatable_; |
| 360 | 349 |
| 361 base::CancelableCallback<void()> delayed_resize_task_; | 350 base::CancelableCallback<void()> delayed_resize_task_; |
| 362 | 351 |
| 363 scoped_ptr<aura::ScopedWindowTargeter> targeter_for_modal_; | |
| 364 | |
| 365 XID modal_dialog_xid_; | |
| 366 | |
| 367 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; | 352 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; |
| 368 | 353 |
| 369 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 354 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
| 370 }; | 355 }; |
| 371 | 356 |
| 372 } // namespace views | 357 } // namespace views |
| 373 | 358 |
| 374 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 359 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
| OLD | NEW |