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/aura/root_window_host_win.h" | 5 #include "ui/aura/root_window_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 saved_window_style_(0), | 45 saved_window_style_(0), |
46 saved_window_ex_style_(0) { | 46 saved_window_ex_style_(0) { |
47 if (use_popup_as_root_window_for_test) | 47 if (use_popup_as_root_window_for_test) |
48 set_window_style(WS_POPUP); | 48 set_window_style(WS_POPUP); |
49 Init(NULL, bounds); | 49 Init(NULL, bounds); |
50 SetWindowText(hwnd(), L"aura::RootWindow!"); | 50 SetWindowText(hwnd(), L"aura::RootWindow!"); |
51 CreateCompositor(GetAcceleratedWidget()); | 51 CreateCompositor(GetAcceleratedWidget()); |
52 } | 52 } |
53 | 53 |
54 WindowTreeHostWin::~WindowTreeHostWin() { | 54 WindowTreeHostWin::~WindowTreeHostWin() { |
| 55 DestroyCompositor(); |
55 DestroyWindow(hwnd()); | 56 DestroyWindow(hwnd()); |
56 } | 57 } |
57 | 58 |
58 RootWindow* WindowTreeHostWin::GetRootWindow() { | 59 RootWindow* WindowTreeHostWin::GetRootWindow() { |
59 return delegate_->AsRootWindow(); | 60 return delegate_->AsRootWindow(); |
60 } | 61 } |
61 | 62 |
62 gfx::AcceleratedWidget WindowTreeHostWin::GetAcceleratedWidget() { | 63 gfx::AcceleratedWidget WindowTreeHostWin::GetAcceleratedWidget() { |
63 return hwnd(); | 64 return hwnd(); |
64 } | 65 } |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 namespace test { | 302 namespace test { |
302 | 303 |
303 // static | 304 // static |
304 void SetUsePopupAsRootWindowForTest(bool use) { | 305 void SetUsePopupAsRootWindowForTest(bool use) { |
305 use_popup_as_root_window_for_test = use; | 306 use_popup_as_root_window_for_test = use; |
306 } | 307 } |
307 | 308 |
308 } // namespace test | 309 } // namespace test |
309 | 310 |
310 } // namespace aura | 311 } // namespace aura |
OLD | NEW |