OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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> |
| 11 #include <atlmisc.h> |
11 | 12 |
12 #include "app/l10n_util_win.h" | 13 #include "app/l10n_util_win.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/win_util.h" | 15 #include "base/win_util.h" |
15 #include "views/background.h" | 16 #include "views/background.h" |
16 #include "views/border.h" | 17 #include "views/border.h" |
17 #include "views/controls/hwnd_view.h" | 18 #include "views/controls/hwnd_view.h" |
18 #include "views/focus/focus_manager.h" | 19 #include "views/focus/focus_manager.h" |
19 #include "views/widget/widget.h" | 20 #include "views/widget/widget.h" |
20 #include "base/gfx/native_theme.h" | 21 #include "base/gfx/native_theme.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 else | 121 else |
121 return 0; | 122 return 0; |
122 } | 123 } |
123 | 124 |
124 void OnDestroy() { | 125 void OnDestroy() { |
125 if (parent_) | 126 if (parent_) |
126 parent_->OnDestroy(); | 127 parent_->OnDestroy(); |
127 TRACK_HWND_DESTRUCTION(m_hWnd); | 128 TRACK_HWND_DESTRUCTION(m_hWnd); |
128 } | 129 } |
129 | 130 |
130 void OnContextMenu(HWND window, const CPoint& location) { | 131 void OnContextMenu(HWND window, const WTL::CPoint& location) { |
131 if (parent_) | 132 if (parent_) |
132 parent_->OnContextMenu(location); | 133 parent_->OnContextMenu(location); |
133 } | 134 } |
134 | 135 |
135 // We need to find an ancestor with a non-null background, and | 136 // We need to find an ancestor with a non-null background, and |
136 // ask it for a (solid color) brush that approximates | 137 // ask it for a (solid color) brush that approximates |
137 // the background. The caller will use this when drawing | 138 // the background. The caller will use this when drawing |
138 // the native control as a background color, particularly | 139 // the native control as a background color, particularly |
139 // for radiobuttons and XP style pushbuttons. | 140 // for radiobuttons and XP style pushbuttons. |
140 LRESULT OnCtlColor(UINT msg, HDC dc, HWND control) { | 141 LRESULT OnCtlColor(UINT msg, HDC dc, HWND control) { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 RemoveProp(window, kHandlerKey); | 377 RemoveProp(window, kHandlerKey); |
377 RemoveProp(window, kNativeControlKey); | 378 RemoveProp(window, kNativeControlKey); |
378 TRACK_HWND_DESTRUCTION(window); | 379 TRACK_HWND_DESTRUCTION(window); |
379 } | 380 } |
380 | 381 |
381 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, | 382 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, |
382 message, w_param, l_param); | 383 message, w_param, l_param); |
383 } | 384 } |
384 | 385 |
385 } // namespace views | 386 } // namespace views |
OLD | NEW |