| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/native_control_win.h" | 5 #include "views/controls/native_control_win.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_win.h" | 7 #include "app/l10n_util_win.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
| 10 #include "views/focus/focus_manager.h" | 10 #include "views/focus/focus_manager.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 LPARAM l_param) { | 189 LPARAM l_param) { |
| 190 NativeControlWin* native_control = | 190 NativeControlWin* native_control = |
| 191 static_cast<NativeControlWin*>(GetProp(window, kNativeControlWinKey)); | 191 static_cast<NativeControlWin*>(GetProp(window, kNativeControlWinKey)); |
| 192 DCHECK(native_control); | 192 DCHECK(native_control); |
| 193 | 193 |
| 194 if (message == WM_KEYDOWN && native_control->NotifyOnKeyDown()) { | 194 if (message == WM_KEYDOWN && native_control->NotifyOnKeyDown()) { |
| 195 if (native_control->OnKeyDown(static_cast<int>(w_param))) | 195 if (native_control->OnKeyDown(static_cast<int>(w_param))) |
| 196 return 0; | 196 return 0; |
| 197 } else if (message == WM_SETFOCUS) { | 197 } else if (message == WM_SETFOCUS) { |
| 198 // Let the focus manager know that the focus changed. | 198 // Let the focus manager know that the focus changed. |
| 199 FocusManager* focus_manager = | 199 FocusManager* focus_manager = native_control->GetFocusManager(); |
| 200 FocusManager::GetFocusManager(native_control->native_view()); | |
| 201 if (focus_manager) { | 200 if (focus_manager) { |
| 202 focus_manager->SetFocusedView(native_control->focus_view()); | 201 focus_manager->SetFocusedView(native_control->focus_view()); |
| 203 } else { | 202 } else { |
| 204 NOTREACHED(); | 203 NOTREACHED(); |
| 205 } | 204 } |
| 206 } else if (message == WM_DESTROY) { | 205 } else if (message == WM_DESTROY) { |
| 207 win_util::SetWindowProc(window, native_control->original_wndproc_); | 206 win_util::SetWindowProc(window, native_control->original_wndproc_); |
| 208 } | 207 } |
| 209 | 208 |
| 210 return CallWindowProc(native_control->original_wndproc_, window, message, | 209 return CallWindowProc(native_control->original_wndproc_, window, message, |
| 211 w_param, l_param); | 210 w_param, l_param); |
| 212 } | 211 } |
| 213 | 212 |
| 214 } // namespace views | 213 } // namespace views |
| OLD | NEW |