| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 139   // for radiobuttons and XP style pushbuttons. | 139   // for radiobuttons and XP style pushbuttons. | 
| 140   LRESULT OnCtlColor(UINT msg, HDC dc, HWND control) { | 140   LRESULT OnCtlColor(UINT msg, HDC dc, HWND control) { | 
| 141     const View *ancestor = parent_; | 141     const View *ancestor = parent_; | 
| 142     while (ancestor) { | 142     while (ancestor) { | 
| 143       const Background *background = ancestor->background(); | 143       const Background *background = ancestor->background(); | 
| 144       if (background) { | 144       if (background) { | 
| 145         HBRUSH brush = background->GetNativeControlBrush(); | 145         HBRUSH brush = background->GetNativeControlBrush(); | 
| 146         if (brush) | 146         if (brush) | 
| 147           return reinterpret_cast<LRESULT>(brush); | 147           return reinterpret_cast<LRESULT>(brush); | 
| 148       } | 148       } | 
| 149       ancestor = ancestor->GetParent(); | 149       ancestor = ancestor->parent(); | 
| 150     } | 150     } | 
| 151 | 151 | 
| 152     // COLOR_BTNFACE is the default for dialog box backgrounds. | 152     // COLOR_BTNFACE is the default for dialog box backgrounds. | 
| 153     return reinterpret_cast<LRESULT>(GetSysColorBrush(COLOR_BTNFACE)); | 153     return reinterpret_cast<LRESULT>(GetSysColorBrush(COLOR_BTNFACE)); | 
| 154   } | 154   } | 
| 155 | 155 | 
| 156   LRESULT OnCtlColorBtn(HDC dc, HWND control) { | 156   LRESULT OnCtlColorBtn(HDC dc, HWND control) { | 
| 157     return OnCtlColor(WM_CTLCOLORBTN, dc, control); | 157     return OnCtlColor(WM_CTLCOLORBTN, dc, control); | 
| 158   } | 158   } | 
| 159 | 159 | 
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 384   } else if (message == WM_DESTROY) { | 384   } else if (message == WM_DESTROY) { | 
| 385     ui::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); | 385     ui::SetWindowProc(window, reinterpret_cast<WNDPROC>(original_handler)); | 
| 386     native_control->container_->prop_.reset(); | 386     native_control->container_->prop_.reset(); | 
| 387   } | 387   } | 
| 388 | 388 | 
| 389   return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, | 389   return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, | 
| 390                         message, w_param, l_param); | 390                         message, w_param, l_param); | 
| 391 } | 391 } | 
| 392 | 392 | 
| 393 }  // namespace views | 393 }  // namespace views | 
| OLD | NEW | 
|---|