OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_win.h" | 5 #include "views/controls/native_control_win.h" |
6 | 6 |
7 #include <windowsx.h> | 7 #include <windowsx.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/base/accessibility/accessibility_types.h" | 10 #include "ui/base/accessibility/accessibility_types.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 *result = GetControlColor(message, reinterpret_cast<HDC>(w_param), | 51 *result = GetControlColor(message, reinterpret_cast<HDC>(w_param), |
52 native_view()); | 52 native_view()); |
53 return true; | 53 return true; |
54 } | 54 } |
55 return false; | 55 return false; |
56 } | 56 } |
57 | 57 |
58 //////////////////////////////////////////////////////////////////////////////// | 58 //////////////////////////////////////////////////////////////////////////////// |
59 // NativeControlWin, View overrides: | 59 // NativeControlWin, View overrides: |
60 | 60 |
61 void NativeControlWin::SetEnabled(bool enabled) { | 61 void NativeControlWin::OnEnabledChanged(bool enabled) { |
62 if (IsEnabled() != enabled) { | 62 if (IsEnabled() != enabled) { |
63 View::SetEnabled(enabled); | 63 View::SetEnabled(enabled); |
Ben Goodger (Google)
2011/05/27 16:01:21
Infinite recursion.
tfarina
2011/05/27 16:25:04
Done.
| |
64 if (native_view()) | 64 if (native_view()) |
65 EnableWindow(native_view(), IsEnabled()); | 65 EnableWindow(native_view(), IsEnabled()); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 void NativeControlWin::ViewHierarchyChanged(bool is_add, View* parent, | 69 void NativeControlWin::ViewHierarchyChanged(bool is_add, View* parent, |
70 View* child) { | 70 View* child) { |
71 // Call the base class to hide the view if we're being removed. | 71 // Call the base class to hide the view if we're being removed. |
72 NativeViewHost::ViewHierarchyChanged(is_add, parent, child); | 72 NativeViewHost::ViewHierarchyChanged(is_add, parent, child); |
73 | 73 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 } else if (message == WM_DESTROY) { | 218 } else if (message == WM_DESTROY) { |
219 native_control->props_.reset(); | 219 native_control->props_.reset(); |
220 ui::SetWindowProc(window, native_control->original_wndproc_); | 220 ui::SetWindowProc(window, native_control->original_wndproc_); |
221 } | 221 } |
222 | 222 |
223 return CallWindowProc(native_control->original_wndproc_, window, message, | 223 return CallWindowProc(native_control->original_wndproc_, window, message, |
224 w_param, l_param); | 224 w_param, l_param); |
225 } | 225 } |
226 | 226 |
227 } // namespace views | 227 } // namespace views |
OLD | NEW |