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