OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/platform_window/win/win_window.h" | 5 #include "ui/platform_window/win/win_window.h" |
6 | 6 |
7 #include "base/profiler/scoped_tracker.h" | 7 #include "base/profiler/scoped_tracker.h" |
8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
10 #include "ui/gfx/win/msg_util.h" | 10 #include "ui/gfx/win/msg_util.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 CHECK(delegate_); | 42 CHECK(delegate_); |
43 if (use_popup_as_root_window_for_test) | 43 if (use_popup_as_root_window_for_test) |
44 set_window_style(WS_POPUP); | 44 set_window_style(WS_POPUP); |
45 gfx::Rect window_bounds = GetWindowBoundsForClientBounds( | 45 gfx::Rect window_bounds = GetWindowBoundsForClientBounds( |
46 WS_OVERLAPPEDWINDOW, window_ex_style(), bounds); | 46 WS_OVERLAPPEDWINDOW, window_ex_style(), bounds); |
47 gfx::WindowImpl::Init(NULL, window_bounds); | 47 gfx::WindowImpl::Init(NULL, window_bounds); |
48 SetWindowText(hwnd(), L"WinWindow"); | 48 SetWindowText(hwnd(), L"WinWindow"); |
49 } | 49 } |
50 | 50 |
51 WinWindow::~WinWindow() { | 51 WinWindow::~WinWindow() { |
52 Destroy(); | |
53 } | 52 } |
54 | 53 |
55 void WinWindow::Destroy() { | 54 void WinWindow::Destroy() { |
56 if (IsWindow(hwnd())) | 55 if (IsWindow(hwnd())) |
57 DestroyWindow(hwnd()); | 56 DestroyWindow(hwnd()); |
58 } | 57 } |
59 | 58 |
60 void WinWindow::Show() { | 59 void WinWindow::Show() { |
61 ShowWindow(hwnd(), SW_SHOWNORMAL); | 60 ShowWindow(hwnd(), SW_SHOWNORMAL); |
62 } | 61 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 213 |
215 namespace test { | 214 namespace test { |
216 | 215 |
217 // static | 216 // static |
218 void SetUsePopupAsRootWindowForTest(bool use) { | 217 void SetUsePopupAsRootWindowForTest(bool use) { |
219 use_popup_as_root_window_for_test = use; | 218 use_popup_as_root_window_for_test = use; |
220 } | 219 } |
221 | 220 |
222 } // namespace test | 221 } // namespace test |
223 } // namespace ui | 222 } // namespace ui |
OLD | NEW |