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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 } | 896 } |
897 | 897 |
898 #if defined(OS_WIN) | 898 #if defined(OS_WIN) |
899 namespace { | 899 namespace { |
900 BOOL CALLBACK WindowCallbackProc(HWND hwnd, LPARAM lParam) { | 900 BOOL CALLBACK WindowCallbackProc(HWND hwnd, LPARAM lParam) { |
901 aura::Window* root_window = | 901 aura::Window* root_window = |
902 DesktopRootWindowHostWin::GetContentWindowForHWND(hwnd); | 902 DesktopRootWindowHostWin::GetContentWindowForHWND(hwnd); |
903 if (root_window) { | 903 if (root_window) { |
904 Widget* widget = Widget::GetWidgetForNativeView(root_window); | 904 Widget* widget = Widget::GetWidgetForNativeView(root_window); |
905 if (widget && widget->is_secondary_widget()) | 905 if (widget && widget->is_secondary_widget()) |
906 widget->Close(); | 906 // To avoid the delay in shutdown caused by using Close which may wait |
| 907 // for animations, use CloseNow. Because this is only used on secondary |
| 908 // widgets it seems relatively safe to skip the extra processing of |
| 909 // Close. |
| 910 widget->CloseNow(); |
907 } | 911 } |
908 return TRUE; | 912 return TRUE; |
909 } | 913 } |
910 } // namespace | 914 } // namespace |
911 #endif | 915 #endif |
912 | 916 |
913 // static | 917 // static |
914 void Widget::CloseAllSecondaryWidgets() { | 918 void Widget::CloseAllSecondaryWidgets() { |
915 #if defined(OS_WIN) | 919 #if defined(OS_WIN) |
916 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); | 920 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 return aura::Env::GetInstance()->is_mouse_button_down(); | 1035 return aura::Env::GetInstance()->is_mouse_button_down(); |
1032 } | 1036 } |
1033 | 1037 |
1034 // static | 1038 // static |
1035 bool NativeWidgetPrivate::IsTouchDown() { | 1039 bool NativeWidgetPrivate::IsTouchDown() { |
1036 return aura::Env::GetInstance()->is_touch_down(); | 1040 return aura::Env::GetInstance()->is_touch_down(); |
1037 } | 1041 } |
1038 | 1042 |
1039 } // namespace internal | 1043 } // namespace internal |
1040 } // namespace views | 1044 } // namespace views |
OLD | NEW |