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

Unified Diff: chrome/views/native_control.cc

Issue 20029: Reverting 9109. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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 | « chrome/browser/renderer_host/render_widget_host_view_win.cc ('k') | chrome/views/text_field.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/native_control.cc
===================================================================
--- chrome/views/native_control.cc (revision 9109)
+++ chrome/views/native_control.cc (working copy)
@@ -79,20 +79,16 @@
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 @@
void OnDestroy() {
if (parent_)
parent_->OnDestroy();
- TRACK_HWND_DESTRUCTION(m_hWnd);
}
void OnContextMenu(HWND window, const CPoint& location) {
@@ -368,7 +363,7 @@
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 @@
reinterpret_cast<WNDPROC>(original_handler));
RemoveProp(window, kHandlerKey);
RemoveProp(window, kNativeControlKey);
- TRACK_HWND_DESTRUCTION(window);
}
return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.cc ('k') | chrome/views/text_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698