| 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/native_control.h" | 5 #include "views/controls/native_control.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlapp.h> | 8 #include <atlapp.h> |
| 9 #include <atlcrack.h> | 9 #include <atlcrack.h> |
| 10 #include <atlframe.h> | 10 #include <atlframe.h> |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 HWND NativeControl::GetNativeControlHWND() { | 281 HWND NativeControl::GetNativeControlHWND() { |
| 282 if (container_) | 282 if (container_) |
| 283 return container_->GetControl(); | 283 return container_->GetControl(); |
| 284 else | 284 else |
| 285 return NULL; | 285 return NULL; |
| 286 } | 286 } |
| 287 | 287 |
| 288 void NativeControl::NativeControlDestroyed() { | 288 void NativeControl::NativeControlDestroyed() { |
| 289 if (hwnd_view_) |
| 290 hwnd_view_->Detach(); |
| 289 container_ = NULL; | 291 container_ = NULL; |
| 290 } | 292 } |
| 291 | 293 |
| 292 void NativeControl::SetVisible(bool f) { | 294 void NativeControl::SetVisible(bool f) { |
| 293 if (f != IsVisible()) { | 295 if (f != IsVisible()) { |
| 294 View::SetVisible(f); | 296 View::SetVisible(f); |
| 295 if (!f && container_) { | 297 if (!f && container_) { |
| 296 ::DestroyWindow(*container_); | 298 ::DestroyWindow(*container_); |
| 297 } else if (f && !container_) { | 299 } else if (f && !container_) { |
| 298 ValidateNativeControl(); | 300 ValidateNativeControl(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 reinterpret_cast<WNDPROC>(original_handler)); | 378 reinterpret_cast<WNDPROC>(original_handler)); |
| 377 RemoveProp(window, kHandlerKey); | 379 RemoveProp(window, kHandlerKey); |
| 378 RemoveProp(window, kNativeControlKey); | 380 RemoveProp(window, kNativeControlKey); |
| 379 } | 381 } |
| 380 | 382 |
| 381 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, | 383 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, |
| 382 message, w_param, l_param); | 384 message, w_param, l_param); |
| 383 } | 385 } |
| 384 | 386 |
| 385 } // namespace views | 387 } // namespace views |
| OLD | NEW |