| 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_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" |
| 6 | 6 |
| 7 #include "base/win/metro.h" | 7 #include "base/win/metro.h" |
| 8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
| 9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 content_window_(NULL), | 81 content_window_(NULL), |
| 82 drag_drop_client_(NULL), | 82 drag_drop_client_(NULL), |
| 83 should_animate_window_close_(false), | 83 should_animate_window_close_(false), |
| 84 pending_close_(false), | 84 pending_close_(false), |
| 85 has_non_client_view_(false), | 85 has_non_client_view_(false), |
| 86 tooltip_(NULL), | 86 tooltip_(NULL), |
| 87 is_cursor_visible_(true) { | 87 is_cursor_visible_(true) { |
| 88 } | 88 } |
| 89 | 89 |
| 90 DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() { | 90 DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() { |
| 91 DestroyCompositor(); | |
| 92 // WARNING: |content_window_| has been destroyed by the time we get here. | 91 // WARNING: |content_window_| has been destroyed by the time we get here. |
| 93 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed( | 92 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed( |
| 94 root_window_); | 93 root_window_); |
| 95 } | 94 } |
| 96 | 95 |
| 97 // static | 96 // static |
| 98 aura::Window* DesktopWindowTreeHostWin::GetContentWindowForHWND(HWND hwnd) { | 97 aura::Window* DesktopWindowTreeHostWin::GetContentWindowForHWND(HWND hwnd) { |
| 99 aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(hwnd); | 98 aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(hwnd); |
| 100 return root ? root->window()->GetProperty(kContentWindowForRootWindow) : NULL; | 99 return root ? root->window()->GetProperty(kContentWindowForRootWindow) : NULL; |
| 101 } | 100 } |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 | 757 |
| 759 native_widget_delegate_->OnNativeWidgetCreated(true); | 758 native_widget_delegate_->OnNativeWidgetCreated(true); |
| 760 | 759 |
| 761 // 1. Window property association | 760 // 1. Window property association |
| 762 // 2. MouseWheel. | 761 // 2. MouseWheel. |
| 763 } | 762 } |
| 764 | 763 |
| 765 void DesktopWindowTreeHostWin::HandleDestroying() { | 764 void DesktopWindowTreeHostWin::HandleDestroying() { |
| 766 drag_drop_client_->OnNativeWidgetDestroying(GetHWND()); | 765 drag_drop_client_->OnNativeWidgetDestroying(GetHWND()); |
| 767 native_widget_delegate_->OnNativeWidgetDestroying(); | 766 native_widget_delegate_->OnNativeWidgetDestroying(); |
| 767 |
| 768 // Destroy the compositor before destroying the HWND since shutdown |
| 769 // may try to swap to the window. |
| 770 DestroyCompositor(); |
| 768 } | 771 } |
| 769 | 772 |
| 770 void DesktopWindowTreeHostWin::HandleDestroyed() { | 773 void DesktopWindowTreeHostWin::HandleDestroyed() { |
| 771 desktop_native_widget_aura_->OnHostClosed(); | 774 desktop_native_widget_aura_->OnHostClosed(); |
| 775 DCHECK_EQ(static_cast<HWND>(NULL), GetHWND()); |
| 772 } | 776 } |
| 773 | 777 |
| 774 bool DesktopWindowTreeHostWin::HandleInitialFocus() { | 778 bool DesktopWindowTreeHostWin::HandleInitialFocus() { |
| 775 return GetWidget()->SetInitialFocus(); | 779 return GetWidget()->SetInitialFocus(); |
| 776 } | 780 } |
| 777 | 781 |
| 778 void DesktopWindowTreeHostWin::HandleDisplayChange() { | 782 void DesktopWindowTreeHostWin::HandleDisplayChange() { |
| 779 GetWidget()->widget_delegate()->OnDisplayChanged(); | 783 GetWidget()->widget_delegate()->OnDisplayChanged(); |
| 780 } | 784 } |
| 781 | 785 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 | 989 |
| 986 // static | 990 // static |
| 987 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 991 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
| 988 internal::NativeWidgetDelegate* native_widget_delegate, | 992 internal::NativeWidgetDelegate* native_widget_delegate, |
| 989 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 993 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 990 return new DesktopWindowTreeHostWin(native_widget_delegate, | 994 return new DesktopWindowTreeHostWin(native_widget_delegate, |
| 991 desktop_native_widget_aura); | 995 desktop_native_widget_aura); |
| 992 } | 996 } |
| 993 | 997 |
| 994 } // namespace views | 998 } // namespace views |
| OLD | NEW |