Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Unified Diff: views/controls/native_control_win.cc

Issue 151002: Fixing focus problems with the combobox (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/native_control_win.h ('k') | views/controls/tree/tree_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native_control_win.cc
===================================================================
--- views/controls/native_control_win.cc (revision 19470)
+++ views/controls/native_control_win.cc (working copy)
@@ -15,12 +15,6 @@
const wchar_t* NativeControlWin::kNativeControlWinKey =
L"__NATIVE_CONTROL_WIN__";
-static const wchar_t* kNativeControlOriginalWndProcKey =
- L"__NATIVE_CONTROL_ORIGINAL_WNDPROC__";
-
-// static
-WNDPROC NativeControlWin::original_wndproc_ = NULL;
-
////////////////////////////////////////////////////////////////////////////////
// NativeControlWin, public:
@@ -118,17 +112,10 @@
// Note that we never unset this property. We don't have to.
SetProp(native_control, kNativeControlWinKey, this);
- // Subclass the window so we can monitor for key presses. It's important that
- // we *only* do this if the derived class wants to intercept keypresses,
- // because otherwise the subclass can mysteriously interfere with certain
- // other controls, like the combobox, and cause weird effects.
- if (NotifyOnKeyDown()) {
- original_wndproc_ =
- win_util::SetWindowProc(native_control,
- &NativeControlWin::NativeControlWndProc);
- SetProp(native_control, kNativeControlOriginalWndProcKey,
- original_wndproc_);
- }
+ // Subclass so we get WM_KEYDOWN and WM_SETFOCUS messages.
+ original_wndproc_ =
+ win_util::SetWindowProc(native_control,
+ &NativeControlWin::NativeControlWndProc);
Attach(native_control);
// native_view() is now valid.
@@ -191,8 +178,8 @@
static_cast<NativeControlWin*>(GetProp(window, kNativeControlWinKey));
DCHECK(native_control);
- if (message == WM_KEYDOWN && native_control->NotifyOnKeyDown()) {
- if (native_control->OnKeyDown(static_cast<int>(w_param)))
+ if (message == WM_KEYDOWN &&
+ native_control->OnKeyDown(static_cast<int>(w_param))) {
return 0;
} else if (message == WM_SETFOCUS) {
// Let the focus manager know that the focus changed.
« no previous file with comments | « views/controls/native_control_win.h ('k') | views/controls/tree/tree_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698