diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 18:47:05 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 18:47:05 +0000 |
commit | 28164cbf4787643ad22efc12b439ba0cff93cc63 (patch) | |
tree | dc6b1ecd04b34252755b6b6452859cb6ee6ad667 /views/controls/native_control_win.cc | |
parent | 416ed618e916018bb154acd52fd39ca1198efd22 (diff) | |
download | chromium_src-28164cbf4787643ad22efc12b439ba0cff93cc63.zip chromium_src-28164cbf4787643ad22efc12b439ba0cff93cc63.tar.gz chromium_src-28164cbf4787643ad22efc12b439ba0cff93cc63.tar.bz2 |
Revert 66784 - Converts usage of SetProp/GetProp to a map. Even after making sure we
clean up props we still leak in a handful of cases that are causing
test grief. By and large our usage of properties is for inside the
application, so that a map works fine.
BUG=61528 44991
Review URL: http://codereview.chromium.org/5075003
TBR=sky@chromium.org
Review URL: http://codereview.chromium.org/5184009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/native_control_win.cc')
-rw-r--r-- | views/controls/native_control_win.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/views/controls/native_control_win.cc b/views/controls/native_control_win.cc index a223993..c4f811c 100644 --- a/views/controls/native_control_win.cc +++ b/views/controls/native_control_win.cc @@ -7,16 +7,14 @@ #include <windowsx.h> #include "app/l10n_util_win.h" -#include "app/view_prop.h" +#include "app/win/scoped_prop.h" #include "base/logging.h" #include "base/win_util.h" #include "views/focus/focus_manager.h" -using app::ViewProp; - namespace views { -static const char* const kNativeControlWinKey = "__NATIVE_CONTROL_WIN__"; +static const wchar_t* kNativeControlWinKey = L"__NATIVE_CONTROL_WIN__"; //////////////////////////////////////////////////////////////////////////////// // NativeControlWin, public: @@ -132,7 +130,8 @@ 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. - props_.push_back(new ViewProp(native_control, kNativeControlWinKey, this)); + 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. @@ -197,8 +196,8 @@ LRESULT NativeControlWin::NativeControlWndProc(HWND window, UINT message, WPARAM w_param, LPARAM l_param) { - NativeControlWin* native_control = reinterpret_cast<NativeControlWin*>( - ViewProp::GetValue(window, kNativeControlWinKey)); + NativeControlWin* native_control = + static_cast<NativeControlWin*>(GetProp(window, kNativeControlWinKey)); DCHECK(native_control); if (message == WM_KEYDOWN && |