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_control.h" | 5 #include "ui/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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 DISALLOW_COPY_AND_ASSIGN(NativeControlContainer); | 171 DISALLOW_COPY_AND_ASSIGN(NativeControlContainer); |
172 }; | 172 }; |
173 | 173 |
174 NativeControl::NativeControl() : hwnd_view_(NULL), | 174 NativeControl::NativeControl() : hwnd_view_(NULL), |
175 container_(NULL), | 175 container_(NULL), |
176 fixed_width_(-1), | 176 fixed_width_(-1), |
177 horizontal_alignment_(CENTER), | 177 horizontal_alignment_(CENTER), |
178 fixed_height_(-1), | 178 fixed_height_(-1), |
179 vertical_alignment_(CENTER) { | 179 vertical_alignment_(CENTER) { |
180 set_focusable(true); | 180 SetFocusable(true); |
181 } | 181 } |
182 | 182 |
183 NativeControl::~NativeControl() { | 183 NativeControl::~NativeControl() { |
184 if (container_) { | 184 if (container_) { |
185 container_->ResetParent(); | 185 container_->ResetParent(); |
186 ::DestroyWindow(*container_); | 186 ::DestroyWindow(*container_); |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 void NativeControl::ValidateNativeControl() { | 190 void NativeControl::ValidateNativeControl() { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } else if (message == WM_DESTROY) { | 380 } else if (message == WM_DESTROY) { |
381 gfx::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); | 381 gfx::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); |
382 native_control->container_->prop_.reset(); | 382 native_control->container_->prop_.reset(); |
383 } | 383 } |
384 | 384 |
385 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, | 385 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, |
386 message, w_param, l_param); | 386 message, w_param, l_param); |
387 } | 387 } |
388 | 388 |
389 } // namespace views | 389 } // namespace views |
OLD | NEW |