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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc

Issue 132473007: aura: Destroy the compositor before destroying the backing window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: destroy-window: Created 6 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/win/window_impl.cc ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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();
772 } 775 }
773 776
774 bool DesktopWindowTreeHostWin::HandleInitialFocus() { 777 bool DesktopWindowTreeHostWin::HandleInitialFocus() {
775 return GetWidget()->SetInitialFocus(); 778 return GetWidget()->SetInitialFocus();
776 } 779 }
777 780
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 993
991 // static 994 // static
992 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( 995 DesktopWindowTreeHost* DesktopWindowTreeHost::Create(
993 internal::NativeWidgetDelegate* native_widget_delegate, 996 internal::NativeWidgetDelegate* native_widget_delegate,
994 DesktopNativeWidgetAura* desktop_native_widget_aura) { 997 DesktopNativeWidgetAura* desktop_native_widget_aura) {
995 return new DesktopWindowTreeHostWin(native_widget_delegate, 998 return new DesktopWindowTreeHostWin(native_widget_delegate,
996 desktop_native_widget_aura); 999 desktop_native_widget_aura);
997 } 1000 }
998 1001
999 } // namespace views 1002 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/win/window_impl.cc ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698