| Index: views/controls/native_control_win.cc
|
| ===================================================================
|
| --- views/controls/native_control_win.cc (revision 19517)
|
| +++ 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.
|
|
|