| 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/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/base/win/hidden_window.h" | 10 #include "ui/base/win/hidden_window.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 NativeViewHostWin::NativeViewHostWin(NativeViewHost* host) | 25 NativeViewHostWin::NativeViewHostWin(NativeViewHost* host) |
| 26 : host_(host), | 26 : host_(host), |
| 27 installed_clip_(false) { | 27 installed_clip_(false) { |
| 28 } | 28 } |
| 29 | 29 |
| 30 NativeViewHostWin::~NativeViewHostWin() { | 30 NativeViewHostWin::~NativeViewHostWin() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 //////////////////////////////////////////////////////////////////////////////// | 33 //////////////////////////////////////////////////////////////////////////////// |
| 34 // NativeViewHostWin, NativeViewHostWrapper implementation: | 34 // NativeViewHostWin, NativeViewHostWrapper implementation: |
| 35 void NativeViewHostWin::NativeViewWillAttach() { | 35 void NativeViewHostWin::AttachNativeView() { |
| 36 // First hide the new window. We don't want anything to draw (like sub-hwnd | 36 // First hide the new window. We don't want anything to draw (like sub-hwnd |
| 37 // borders), when NativeViewHost changes the parent. | 37 // borders), when the parent changes. |
| 38 ShowWindow(host_->native_view(), SW_HIDE); | 38 ShowWindow(host_->native_view(), SW_HIDE); |
| 39 |
| 40 Widget::ReparentNativeView(host_->native_view(), |
| 41 host_->GetWidget()->GetNativeView()); |
| 42 |
| 39 } | 43 } |
| 40 | 44 |
| 41 void NativeViewHostWin::NativeViewDetaching(bool destroyed) { | 45 void NativeViewHostWin::NativeViewDetaching(bool destroyed) { |
| 42 if (!destroyed) { | 46 if (!destroyed) { |
| 43 if (installed_clip_) | 47 if (installed_clip_) |
| 44 UninstallClip(); | 48 UninstallClip(); |
| 45 Widget::ReparentNativeView(host_->native_view(), ui::GetHiddenWindow()); | 49 Widget::ReparentNativeView(host_->native_view(), ui::GetHiddenWindow()); |
| 46 } | 50 } |
| 47 installed_clip_ = false; | 51 installed_clip_ = false; |
| 48 } | 52 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 //////////////////////////////////////////////////////////////////////////////// | 152 //////////////////////////////////////////////////////////////////////////////// |
| 149 // NativeViewHostWrapper, public: | 153 // NativeViewHostWrapper, public: |
| 150 | 154 |
| 151 // static | 155 // static |
| 152 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( | 156 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( |
| 153 NativeViewHost* host) { | 157 NativeViewHost* host) { |
| 154 return new NativeViewHostWin(host); | 158 return new NativeViewHostWin(host); |
| 155 } | 159 } |
| 156 | 160 |
| 157 } // namespace views | 161 } // namespace views |
| OLD | NEW |