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.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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // This message ensures that the focus border is shown. | 194 // This message ensures that the focus border is shown. |
195 ::SendMessage(container_->GetControl(), | 195 ::SendMessage(container_->GetControl(), |
196 WM_CHANGEUISTATE, | 196 WM_CHANGEUISTATE, |
197 MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), | 197 MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), |
198 0); | 198 0); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 void NativeControl::ViewHierarchyChanged(bool is_add, View *parent, | 202 void NativeControl::ViewHierarchyChanged(bool is_add, View *parent, |
203 View *child) { | 203 View *child) { |
204 if (is_add && child == this && GetWidget()) { | 204 if (is_add && parent != this && !container_ && GetWidget()) { |
205 ValidateNativeControl(); | 205 ValidateNativeControl(); |
206 Layout(); | 206 Layout(); |
207 } | 207 } |
208 } | 208 } |
209 | 209 |
210 void NativeControl::Layout() { | 210 void NativeControl::Layout() { |
211 if (!container_ && GetWidget()) | 211 if (!container_ && GetWidget()) |
212 ValidateNativeControl(); | 212 ValidateNativeControl(); |
213 | 213 |
214 if (hwnd_view_) { | 214 if (hwnd_view_) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 reinterpret_cast<WNDPROC>(original_handler)); | 373 reinterpret_cast<WNDPROC>(original_handler)); |
374 RemoveProp(window, kHandlerKey); | 374 RemoveProp(window, kHandlerKey); |
375 RemoveProp(window, kNativeControlKey); | 375 RemoveProp(window, kNativeControlKey); |
376 } | 376 } |
377 | 377 |
378 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, | 378 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, |
379 message, w_param, l_param); | 379 message, w_param, l_param); |
380 } | 380 } |
381 | 381 |
382 } // namespace views | 382 } // namespace views |
OLD | NEW |