summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 23:34:04 +0000
committerojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 23:34:04 +0000
commit83f8b61d6498f23b6e74598bffa9866fda52ea3a (patch)
tree6359863ae2d40e953a8c4b7cf27e1664dd08a09b /chrome/views
parent0dea0a65b4cabd5910fb8747a0cb3935a27e6ec5 (diff)
downloadchromium_src-83f8b61d6498f23b6e74598bffa9866fda52ea3a.zip
chromium_src-83f8b61d6498f23b6e74598bffa9866fda52ea3a.tar.gz
chromium_src-83f8b61d6498f23b6e74598bffa9866fda52ea3a.tar.bz2
Reverting 9109.
Broke the build. Review URL: http://codereview.chromium.org/20029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9110 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/native_control.cc24
-rw-r--r--chrome/views/text_field.cc13
-rw-r--r--chrome/views/widget_win.cc3
3 files changed, 9 insertions, 31 deletions
diff --git a/chrome/views/native_control.cc b/chrome/views/native_control.cc
index 1490f27..3c0e8d0 100644
--- a/chrome/views/native_control.cc
+++ b/chrome/views/native_control.cc
@@ -79,20 +79,16 @@ class NativeControlContainer : public CWindowImpl<NativeControlContainer,
private:
LRESULT OnCreate(LPCREATESTRUCT create_struct) {
- TRACK_HWND_CREATION(m_hWnd);
-
control_ = parent_->CreateNativeControl(m_hWnd);
- TRACK_HWND_CREATION(control_);
-
FocusManager::InstallFocusSubclass(control_, parent_);
-
- // We subclass the control hwnd so we get the WM_KEYDOWN messages.
- WNDPROC original_handler =
- win_util::SetWindowProc(control_,
- &NativeControl::NativeControlWndProc);
- SetProp(control_, kHandlerKey, original_handler);
- SetProp(control_, kNativeControlKey , parent_);
-
+ if (parent_->NotifyOnKeyDown()) {
+ // We subclass the control hwnd so we get the WM_KEYDOWN messages.
+ WNDPROC original_handler =
+ win_util::SetWindowProc(control_,
+ &NativeControl::NativeControlWndProc);
+ SetProp(control_, kHandlerKey, original_handler);
+ SetProp(control_, kNativeControlKey , parent_);
+ }
::ShowWindow(control_, SW_SHOW);
return 1;
}
@@ -125,7 +121,6 @@ class NativeControlContainer : public CWindowImpl<NativeControlContainer,
void OnDestroy() {
if (parent_)
parent_->OnDestroy();
- TRACK_HWND_DESTRUCTION(m_hWnd);
}
void OnContextMenu(HWND window, const CPoint& location) {
@@ -368,7 +363,7 @@ LRESULT CALLBACK NativeControl::NativeControlWndProc(HWND window, UINT message,
static_cast<NativeControl*>(GetProp(window, kNativeControlKey));
DCHECK(native_control);
- if (message == WM_KEYDOWN && native_control->NotifyOnKeyDown()) {
+ if (message == WM_KEYDOWN) {
if (native_control->OnKeyDown(static_cast<int>(w_param)))
return 0;
} else if (message == WM_DESTROY) {
@@ -376,7 +371,6 @@ LRESULT CALLBACK NativeControl::NativeControlWndProc(HWND window, UINT message,
reinterpret_cast<WNDPROC>(original_handler));
RemoveProp(window, kHandlerKey);
RemoveProp(window, kNativeControlKey);
- TRACK_HWND_DESTRUCTION(window);
}
return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
diff --git a/chrome/views/text_field.cc b/chrome/views/text_field.cc
index 7c4e2fd..79ee7b9 100644
--- a/chrome/views/text_field.cc
+++ b/chrome/views/text_field.cc
@@ -70,9 +70,7 @@ class TextField::Edit
MSG_WM_CHAR(OnChar)
MSG_WM_CONTEXTMENU(OnContextMenu)
MSG_WM_COPY(OnCopy)
- MSG_WM_CREATE(OnCreate)
MSG_WM_CUT(OnCut)
- MSG_WM_DESTROY(OnDestroy)
MESSAGE_HANDLER_EX(WM_IME_STARTCOMPOSITION, OnImeStartComposition)
MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeComposition)
MSG_WM_KEYDOWN(OnKeyDown)
@@ -118,9 +116,7 @@ class TextField::Edit
void OnChar(TCHAR key, UINT repeat_count, UINT flags);
void OnContextMenu(HWND window, const CPoint& point);
void OnCopy();
- LRESULT OnCreate(CREATESTRUCT* create_struct);
void OnCut();
- void OnDestroy();
LRESULT OnImeStartComposition(UINT message, WPARAM wparam, LPARAM lparam);
LRESULT OnImeComposition(UINT message, WPARAM wparam, LPARAM lparam);
void OnKeyDown(TCHAR key, UINT repeat_count, UINT flags);
@@ -418,11 +414,6 @@ void TextField::Edit::OnCopy() {
}
}
-LRESULT TextField::Edit::OnCreate(CREATESTRUCT* create_struct) {
- TRACK_HWND_CREATION(m_hWnd);
- return 0;
-}
-
void TextField::Edit::OnCut() {
if (parent_->IsReadOnly())
return;
@@ -434,10 +425,6 @@ void TextField::Edit::OnCut() {
ReplaceSel(L"", true);
}
-void TextField::Edit::OnDestroy() {
- TRACK_HWND_DESTRUCTION(m_hWnd);
-}
-
LRESULT TextField::Edit::OnImeStartComposition(UINT message,
WPARAM wparam,
LPARAM lparam) {
diff --git a/chrome/views/widget_win.cc b/chrome/views/widget_win.cc
index 5e60e38..7268a59 100644
--- a/chrome/views/widget_win.cc
+++ b/chrome/views/widget_win.cc
@@ -162,8 +162,6 @@ void WidgetWin::Init(HWND parent, const gfx::Rect& bounds,
window_style_, bounds.x(), bounds.y(), bounds.width(),
bounds.height(), parent, NULL, NULL, this);
DCHECK(hwnd_);
- TRACK_HWND_CREATION(hwnd_);
-
// The window procedure should have set the data for us.
DCHECK(win_util::GetWindowUserData(hwnd_) == this);
@@ -934,7 +932,6 @@ LRESULT CALLBACK WidgetWin::WndProc(HWND window, UINT message,
if (!widget->ProcessWindowMessage(window, message, w_param, l_param, result))
result = DefWindowProc(window, message, w_param, l_param);
if (message == WM_NCDESTROY) {
- TRACK_HWND_DESTRUCTION(window);
widget->hwnd_ = NULL;
widget->OnFinalMessage(window);
}