OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/controls/hwnd_view.h" | 5 #include "views/controls/hwnd_view.h" |
6 | 6 |
7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "views/focus/focus_manager.h" | 9 #include "views/focus/focus_manager.h" |
10 #include "views/widget/widget.h" | 10 #include "views/widget/widget.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 | 13 |
14 static const char kViewClassName[] = "views/HWNDView"; | 14 static const char kViewClassName[] = "views/HWNDView"; |
15 | 15 |
16 HWNDView::HWNDView() { | 16 HWNDView::HWNDView() : NativeViewHost() { |
17 } | 17 } |
18 | 18 |
19 HWNDView::~HWNDView() { | 19 HWNDView::~HWNDView() { |
20 } | 20 } |
21 | 21 |
22 void HWNDView::Attach(HWND hwnd) { | 22 void HWNDView::Attach(HWND hwnd) { |
23 DCHECK(native_view() == NULL); | 23 DCHECK(native_view() == NULL); |
24 DCHECK(hwnd) << "Impossible detatched tab case; See crbug.com/6316"; | 24 DCHECK(hwnd) << "Impossible detatched tab case; See crbug.com/6316"; |
25 | 25 |
26 set_native_view(hwnd); | 26 set_native_view(hwnd); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 return; // Currently not visible, nothing to do. | 129 return; // Currently not visible, nothing to do. |
130 | 130 |
131 // The window is currently visible, but its clipped by another view. Hide | 131 // The window is currently visible, but its clipped by another view. Hide |
132 // it. | 132 // it. |
133 ::SetWindowPos(native_view(), 0, 0, 0, 0, 0, | 133 ::SetWindowPos(native_view(), 0, 0, 0, 0, 0, |
134 SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | | 134 SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | |
135 SWP_NOREDRAW | SWP_NOOWNERZORDER); | 135 SWP_NOREDRAW | SWP_NOOWNERZORDER); |
136 } | 136 } |
137 | 137 |
138 } // namespace views | 138 } // namespace views |
OLD | NEW |