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

Unified Diff: views/controls/native_control_win.cc

Issue 4637002: Adds the ability for classes other than native control to process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Tweaks Created 10 years, 1 month 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/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native_control_win.cc
diff --git a/views/controls/native_control_win.cc b/views/controls/native_control_win.cc
index 0c6d257feca317d992d510767f96643cf2893be0..c4f811cc9a5de4caca6c8230bc66c0cccbc622a3 100644
--- a/views/controls/native_control_win.cc
+++ b/views/controls/native_control_win.cc
@@ -14,9 +14,7 @@
namespace views {
-// static
-const wchar_t* NativeControlWin::kNativeControlWinKey =
- L"__NATIVE_CONTROL_WIN__";
+static const wchar_t* kNativeControlWinKey = L"__NATIVE_CONTROL_WIN__";
////////////////////////////////////////////////////////////////////////////////
// NativeControlWin, public:
@@ -35,8 +33,10 @@ NativeControlWin::~NativeControlWin() {
}
}
-bool NativeControlWin::ProcessMessage(UINT message, WPARAM w_param,
- LPARAM l_param, LRESULT* result) {
+bool NativeControlWin::ProcessMessage(UINT message,
+ WPARAM w_param,
+ LPARAM l_param,
+ LRESULT* result) {
switch (message) {
case WM_CONTEXTMENU:
ShowContextMenu(gfx::Point(GET_X_LPARAM(l_param), GET_Y_LPARAM(l_param)));
@@ -130,8 +130,9 @@ void NativeControlWin::ShowContextMenu(const gfx::Point& location) {
void NativeControlWin::NativeControlCreated(HWND native_control) {
// Associate this object with the control's HWND so that WidgetWin can find
// this object when it receives messages from it.
- prop_.reset(
+ props_.push_back(
new app::win::ScopedProp(native_control, kNativeControlWinKey, this));
+ props_.push_back(ChildWindowMessageProcessor::Register(native_control, this));
// Subclass so we get WM_KEYDOWN and WM_SETFOCUS messages.
original_wndproc_ =
@@ -211,7 +212,7 @@ LRESULT NativeControlWin::NativeControlWndProc(HWND window,
NOTREACHED();
}
} else if (message == WM_DESTROY) {
- native_control->prop_.reset();
+ native_control->props_.reset();
win_util::SetWindowProc(window, native_control->original_wndproc_);
}
« no previous file with comments | « views/controls/native_control_win.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698