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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.h

Issue 2471033005: Adds DesktopWindowTreeHostMus (Closed)
Patch Set: fix Created 4 years, 1 month 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_NATIVE_WIDGET_AURA_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 public aura::client::DragDropDelegate, 61 public aura::client::DragDropDelegate,
62 public aura::WindowTreeHostObserver { 62 public aura::WindowTreeHostObserver {
63 public: 63 public:
64 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate); 64 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate);
65 ~DesktopNativeWidgetAura() override; 65 ~DesktopNativeWidgetAura() override;
66 66
67 // Maps from window to DesktopNativeWidgetAura. |window| must be a root 67 // Maps from window to DesktopNativeWidgetAura. |window| must be a root
68 // window. 68 // window.
69 static DesktopNativeWidgetAura* ForWindow(aura::Window* window); 69 static DesktopNativeWidgetAura* ForWindow(aura::Window* window);
70 70
71 // Used to explicitly set a DesktopWindowTreeHost. Must be called before
72 // InitNativeWidget().
73 void SetDesktopWindowTreeHost(
74 std::unique_ptr<DesktopWindowTreeHost> desktop_window_tree_host);
75
71 // Called by our DesktopWindowTreeHost after it has deleted native resources; 76 // Called by our DesktopWindowTreeHost after it has deleted native resources;
72 // this is the signal that we should start our shutdown. 77 // this is the signal that we should start our shutdown.
73 virtual void OnHostClosed(); 78 virtual void OnHostClosed();
74 79
75 // TODO(beng): remove this method and replace with an implementation of 80 // TODO(beng): remove this method and replace with an implementation of
76 // WindowDestroying() that takes the window being destroyed. 81 // WindowDestroying() that takes the window being destroyed.
77 // Called from ~DesktopWindowTreeHost. This takes the WindowEventDispatcher 82 // Called from ~DesktopWindowTreeHost. This takes the WindowEventDispatcher
78 // as by the time we get here |dispatcher_| is NULL. 83 // as by the time we get here |dispatcher_| is NULL.
79 virtual void OnDesktopWindowTreeHostDestroyed(aura::WindowTreeHost* host); 84 virtual void OnDesktopWindowTreeHostDestroyed(aura::WindowTreeHost* host);
80 85
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 287
283 gfx::NativeCursor cursor_; 288 gfx::NativeCursor cursor_;
284 // We must manually reference count the number of users of |cursor_manager_| 289 // We must manually reference count the number of users of |cursor_manager_|
285 // because the cursors created by |cursor_manager_| are shared among the 290 // because the cursors created by |cursor_manager_| are shared among the
286 // DNWAs. We can't just stuff this in a LazyInstance because we need to 291 // DNWAs. We can't just stuff this in a LazyInstance because we need to
287 // destroy this as the last DNWA happens; we can't put it off until 292 // destroy this as the last DNWA happens; we can't put it off until
288 // (potentially) after we tear down the X11 connection because that's a 293 // (potentially) after we tear down the X11 connection because that's a
289 // crash. 294 // crash.
290 static int cursor_reference_count_; 295 static int cursor_reference_count_;
291 static wm::CursorManager* cursor_manager_; 296 static wm::CursorManager* cursor_manager_;
292 static views::DesktopNativeCursorManager* native_cursor_manager_; 297 static DesktopNativeCursorManager* native_cursor_manager_;
293 298
294 std::unique_ptr<wm::ShadowController> shadow_controller_; 299 std::unique_ptr<wm::ShadowController> shadow_controller_;
295 300
296 // Reorders child windows of |window_| associated with a view based on the 301 // Reorders child windows of |window_| associated with a view based on the
297 // order of the associated views in the widget's view hierarchy. 302 // order of the associated views in the widget's view hierarchy.
298 std::unique_ptr<WindowReorderer> window_reorderer_; 303 std::unique_ptr<WindowReorderer> window_reorderer_;
299 304
300 // See class documentation for Widget in widget.h for a note about type. 305 // See class documentation for Widget in widget.h for a note about type.
301 Widget::InitParams::Type widget_type_; 306 Widget::InitParams::Type widget_type_;
302 307
303 // The following factory is used for calls to close the NativeWidgetAura 308 // The following factory is used for calls to close the NativeWidgetAura
304 // instance. 309 // instance.
305 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_; 310 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_;
306 311
307 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); 312 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura);
308 }; 313 };
309 314
310 } // namespace views 315 } // namespace views
311 316
312 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ 317 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698