Chromium Code Reviews| 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 "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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 if (f != IsVisible()) { | 305 if (f != IsVisible()) { |
| 306 View::SetVisible(f); | 306 View::SetVisible(f); |
| 307 if (!f && container_) { | 307 if (!f && container_) { |
| 308 ::DestroyWindow(*container_); | 308 ::DestroyWindow(*container_); |
| 309 } else if (f && !container_) { | 309 } else if (f && !container_) { |
| 310 ValidateNativeControl(); | 310 ValidateNativeControl(); |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 | 314 |
| 315 void NativeControl::SetEnabled(bool enabled) { | 315 void NativeControl::OnEnabledChanged(bool enabled) { |
| 316 if (enabled_ != enabled) { | 316 if (enabled_ != enabled) { |
| 317 View::SetEnabled(enabled); | 317 View::SetEnabled(enabled); |
|
Ben Goodger (Google)
2011/05/27 16:01:21
Infinite recursion.
tfarina
2011/05/27 16:25:04
Done.
| |
| 318 if (GetNativeControlHWND()) { | 318 if (GetNativeControlHWND()) |
| 319 EnableWindow(GetNativeControlHWND(), enabled_); | 319 EnableWindow(GetNativeControlHWND(), enabled_); |
| 320 } | |
| 321 } | 320 } |
| 322 } | 321 } |
| 323 | 322 |
| 324 void NativeControl::OnPaint(gfx::Canvas* canvas) { | 323 void NativeControl::OnPaint(gfx::Canvas* canvas) { |
| 325 } | 324 } |
| 326 | 325 |
| 327 void NativeControl::VisibilityChanged(View* starting_from, bool is_visible) { | 326 void NativeControl::VisibilityChanged(View* starting_from, bool is_visible) { |
| 328 SetVisible(is_visible); | 327 SetVisible(is_visible); |
| 329 } | 328 } |
| 330 | 329 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 387 } else if (message == WM_DESTROY) { | 386 } else if (message == WM_DESTROY) { |
| 388 ui::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); | 387 ui::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); |
| 389 native_control->container_->prop_.reset(); | 388 native_control->container_->prop_.reset(); |
| 390 } | 389 } |
| 391 | 390 |
| 392 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, | 391 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, |
| 393 message, w_param, l_param); | 392 message, w_param, l_param); |
| 394 } | 393 } |
| 395 | 394 |
| 396 } // namespace views | 395 } // namespace views |
| OLD | NEW |