OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/controls/native/native_view_host_win.h" | 5 #include "ui/views/controls/native/native_view_host_win.h" |
6 | 6 |
7 #include <oleacc.h> | 7 #include <oleacc.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 installed_clip_ = false; | 48 installed_clip_ = false; |
49 } | 49 } |
50 | 50 |
51 void NativeViewHostWin::AddedToWidget() { | 51 void NativeViewHostWin::AddedToWidget() { |
52 if (!IsWindow(host_->native_view())) | 52 if (!IsWindow(host_->native_view())) |
53 return; | 53 return; |
54 HWND parent_hwnd = GetParent(host_->native_view()); | 54 HWND parent_hwnd = GetParent(host_->native_view()); |
55 HWND widget_hwnd = host_->GetWidget()->GetNativeView(); | 55 HWND widget_hwnd = host_->GetWidget()->GetNativeView(); |
56 if (parent_hwnd != widget_hwnd) | 56 if (parent_hwnd != widget_hwnd) |
57 SetParent(host_->native_view(), widget_hwnd); | 57 SetParent(host_->native_view(), widget_hwnd); |
58 if (host_->IsVisibleInRootView()) | 58 if (host_->IsDrawn()) |
59 ShowWindow(host_->native_view(), SW_SHOW); | 59 ShowWindow(host_->native_view(), SW_SHOW); |
60 else | 60 else |
61 ShowWindow(host_->native_view(), SW_HIDE); | 61 ShowWindow(host_->native_view(), SW_HIDE); |
62 host_->Layout(); | 62 host_->Layout(); |
63 } | 63 } |
64 | 64 |
65 void NativeViewHostWin::RemovedFromWidget() { | 65 void NativeViewHostWin::RemovedFromWidget() { |
66 if (!IsWindow(host_->native_view())) | 66 if (!IsWindow(host_->native_view())) |
67 return; | 67 return; |
68 ShowWindow(host_->native_view(), SW_HIDE); | 68 ShowWindow(host_->native_view(), SW_HIDE); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 //////////////////////////////////////////////////////////////////////////////// | 145 //////////////////////////////////////////////////////////////////////////////// |
146 // NativeViewHostWrapper, public: | 146 // NativeViewHostWrapper, public: |
147 | 147 |
148 // static | 148 // static |
149 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( | 149 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( |
150 NativeViewHost* host) { | 150 NativeViewHost* host) { |
151 return new NativeViewHostWin(host); | 151 return new NativeViewHostWin(host); |
152 } | 152 } |
153 | 153 |
154 } // namespace views | 154 } // namespace views |
OLD | NEW |