| 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(); |
| 91 // WARNING: |content_window_| has been destroyed by the time we get here. | 92 // WARNING: |content_window_| has been destroyed by the time we get here. |
| 92 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed( | 93 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed( |
| 93 root_window_); | 94 root_window_); |
| 94 } | 95 } |
| 95 | 96 |
| 96 // static | 97 // static |
| 97 aura::Window* DesktopWindowTreeHostWin::GetContentWindowForHWND(HWND hwnd) { | 98 aura::Window* DesktopWindowTreeHostWin::GetContentWindowForHWND(HWND hwnd) { |
| 98 aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(hwnd); | 99 aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(hwnd); |
| 99 return root ? root->window()->GetProperty(kContentWindowForRootWindow) : NULL; | 100 return root ? root->window()->GetProperty(kContentWindowForRootWindow) : NULL; |
| 100 } | 101 } |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 | 763 |
| 763 native_widget_delegate_->OnNativeWidgetCreated(true); | 764 native_widget_delegate_->OnNativeWidgetCreated(true); |
| 764 | 765 |
| 765 // 1. Window property association | 766 // 1. Window property association |
| 766 // 2. MouseWheel. | 767 // 2. MouseWheel. |
| 767 } | 768 } |
| 768 | 769 |
| 769 void DesktopWindowTreeHostWin::HandleDestroying() { | 770 void DesktopWindowTreeHostWin::HandleDestroying() { |
| 770 drag_drop_client_->OnNativeWidgetDestroying(GetHWND()); | 771 drag_drop_client_->OnNativeWidgetDestroying(GetHWND()); |
| 771 native_widget_delegate_->OnNativeWidgetDestroying(); | 772 native_widget_delegate_->OnNativeWidgetDestroying(); |
| 772 | |
| 773 // Destroy the compositor before destroying the HWND since shutdown | |
| 774 // may try to swap to the window. | |
| 775 DestroyCompositor(); | |
| 776 } | 773 } |
| 777 | 774 |
| 778 void DesktopWindowTreeHostWin::HandleDestroyed() { | 775 void DesktopWindowTreeHostWin::HandleDestroyed() { |
| 779 desktop_native_widget_aura_->OnHostClosed(); | 776 desktop_native_widget_aura_->OnHostClosed(); |
| 780 } | 777 } |
| 781 | 778 |
| 782 bool DesktopWindowTreeHostWin::HandleInitialFocus() { | 779 bool DesktopWindowTreeHostWin::HandleInitialFocus() { |
| 783 return GetWidget()->SetInitialFocus(); | 780 return GetWidget()->SetInitialFocus(); |
| 784 } | 781 } |
| 785 | 782 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 | 995 |
| 999 // static | 996 // static |
| 1000 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 997 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
| 1001 internal::NativeWidgetDelegate* native_widget_delegate, | 998 internal::NativeWidgetDelegate* native_widget_delegate, |
| 1002 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 999 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 1003 return new DesktopWindowTreeHostWin(native_widget_delegate, | 1000 return new DesktopWindowTreeHostWin(native_widget_delegate, |
| 1004 desktop_native_widget_aura); | 1001 desktop_native_widget_aura); |
| 1005 } | 1002 } |
| 1006 | 1003 |
| 1007 } // namespace views | 1004 } // namespace views |
| OLD | NEW |