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 #include "ui/views/widget/desktop_aura/desktop_root_window_host_linux.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_linux.h" |
6 | 6 |
7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
10 | 10 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 MessageLoop::current()->PostTask( | 330 MessageLoop::current()->PostTask( |
331 FROM_HERE, | 331 FROM_HERE, |
332 base::Bind(&DesktopRootWindowHostLinux::CloseNow, | 332 base::Bind(&DesktopRootWindowHostLinux::CloseNow, |
333 close_widget_factory_.GetWeakPtr())); | 333 close_widget_factory_.GetWeakPtr())); |
334 } | 334 } |
335 } | 335 } |
336 | 336 |
337 void DesktopRootWindowHostLinux::CloseNow() { | 337 void DesktopRootWindowHostLinux::CloseNow() { |
338 if (xwindow_ == None) | 338 if (xwindow_ == None) |
339 return; | 339 return; |
| 340 |
| 341 native_widget_delegate_->OnNativeWidgetDestroying(); |
| 342 |
340 // Remove the event listeners we've installed. We need to remove these | 343 // Remove the event listeners we've installed. We need to remove these |
341 // because otherwise we get assert during ~RootWindow(). | 344 // because otherwise we get assert during ~RootWindow(). |
342 desktop_native_widget_aura_->root_window_event_filter()->RemoveHandler( | 345 desktop_native_widget_aura_->root_window_event_filter()->RemoveHandler( |
343 x11_window_event_filter_.get()); | 346 x11_window_event_filter_.get()); |
344 | 347 |
345 // Actually free our native resources. | 348 // Actually free our native resources. |
346 base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(xwindow_); | 349 base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(xwindow_); |
347 XDestroyWindow(xdisplay_, xwindow_); | 350 XDestroyWindow(xdisplay_, xwindow_); |
348 xwindow_ = None; | 351 xwindow_ = None; |
349 | 352 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1096 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
1094 internal::NativeWidgetDelegate* native_widget_delegate, | 1097 internal::NativeWidgetDelegate* native_widget_delegate, |
1095 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1098 DesktopNativeWidgetAura* desktop_native_widget_aura, |
1096 const gfx::Rect& initial_bounds) { | 1099 const gfx::Rect& initial_bounds) { |
1097 return new DesktopRootWindowHostLinux(native_widget_delegate, | 1100 return new DesktopRootWindowHostLinux(native_widget_delegate, |
1098 desktop_native_widget_aura, | 1101 desktop_native_widget_aura, |
1099 initial_bounds); | 1102 initial_bounds); |
1100 } | 1103 } |
1101 | 1104 |
1102 } // namespace views | 1105 } // namespace views |
OLD | NEW |