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_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 361 } |
362 | 362 |
363 void DesktopRootWindowHostX11::Close() { | 363 void DesktopRootWindowHostX11::Close() { |
364 // TODO(erg): Might need to do additional hiding tasks here. | 364 // TODO(erg): Might need to do additional hiding tasks here. |
365 | 365 |
366 if (!close_widget_factory_.HasWeakPtrs()) { | 366 if (!close_widget_factory_.HasWeakPtrs()) { |
367 // And we delay the close so that if we are called from an ATL callback, | 367 // And we delay the close so that if we are called from an ATL callback, |
368 // we don't destroy the window before the callback returned (as the caller | 368 // we don't destroy the window before the callback returned (as the caller |
369 // may delete ourselves on destroy and the ATL callback would still | 369 // may delete ourselves on destroy and the ATL callback would still |
370 // dereference us when the callback returns). | 370 // dereference us when the callback returns). |
371 MessageLoop::current()->PostTask( | 371 base::MessageLoop::current()->PostTask( |
372 FROM_HERE, | 372 FROM_HERE, |
373 base::Bind(&DesktopRootWindowHostX11::CloseNow, | 373 base::Bind(&DesktopRootWindowHostX11::CloseNow, |
374 close_widget_factory_.GetWeakPtr())); | 374 close_widget_factory_.GetWeakPtr())); |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
378 void DesktopRootWindowHostX11::CloseNow() { | 378 void DesktopRootWindowHostX11::CloseNow() { |
379 if (xwindow_ == None) | 379 if (xwindow_ == None) |
380 return; | 380 return; |
381 | 381 |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1206 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
1207 internal::NativeWidgetDelegate* native_widget_delegate, | 1207 internal::NativeWidgetDelegate* native_widget_delegate, |
1208 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1208 DesktopNativeWidgetAura* desktop_native_widget_aura, |
1209 const gfx::Rect& initial_bounds) { | 1209 const gfx::Rect& initial_bounds) { |
1210 return new DesktopRootWindowHostX11(native_widget_delegate, | 1210 return new DesktopRootWindowHostX11(native_widget_delegate, |
1211 desktop_native_widget_aura, | 1211 desktop_native_widget_aura, |
1212 initial_bounds); | 1212 initial_bounds); |
1213 } | 1213 } |
1214 | 1214 |
1215 } // namespace views | 1215 } // namespace views |
OLD | NEW |