From 3b8a7f8e37e223f3cfbdb6893a3e372ba1e72bc2 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Sun, 21 Nov 2010 22:44:21 +0000 Subject: Attempt 2 at: 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 TEST=none TBR=cpu@chromium.org Review URL: http://codereview.chromium.org/5144005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66920 0039d316-1c4b-4281-b951-d872f2087c98 --- views/focus/focus_util_win.cc | 18 ++++++++++-------- views/focus/focus_util_win.h | 10 ++++------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'views/focus') diff --git a/views/focus/focus_util_win.cc b/views/focus/focus_util_win.cc index 266a891..23172ad 100644 --- a/views/focus/focus_util_win.cc +++ b/views/focus/focus_util_win.cc @@ -6,24 +6,26 @@ #include -#include "app/win/scoped_prop.h" +#include "app/view_prop.h" #include "base/auto_reset.h" #include "base/win_util.h" +using app::ViewProp; + namespace views { // Property used to indicate the HWND supports having mouse wheel messages // rerouted to it. -static const wchar_t* const kHWNDSupportMouseWheelRerouting = - L"__HWND_MW_REROUTE_OK"; +static const char* const kHWNDSupportMouseWheelRerouting = + "__HWND_MW_REROUTE_OK"; static bool WindowSupportsRerouteMouseWheel(HWND window) { while (GetWindowLong(window, GWL_STYLE) & WS_CHILD) { if (!IsWindow(window)) break; - if (reinterpret_cast(GetProp(window, - kHWNDSupportMouseWheelRerouting))) { + if (reinterpret_cast( + ViewProp::GetValue(window, kHWNDSupportMouseWheelRerouting))) { return true; } window = GetParent(window); @@ -53,9 +55,9 @@ static bool CanRedirectMouseWheelFrom(HWND window) { return true; } -app::win::ScopedProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd) { - return new app::win::ScopedProp(hwnd, kHWNDSupportMouseWheelRerouting, - reinterpret_cast(true)); +ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd) { + return new ViewProp(hwnd, kHWNDSupportMouseWheelRerouting, + reinterpret_cast(true)); } bool RerouteMouseWheel(HWND window, WPARAM w_param, LPARAM l_param) { diff --git a/views/focus/focus_util_win.h b/views/focus/focus_util_win.h index 2c53c68..6394f5d 100644 --- a/views/focus/focus_util_win.h +++ b/views/focus/focus_util_win.h @@ -9,18 +9,16 @@ #include namespace app { -namespace win { -class ScopedProp; -} +class ViewProp; } namespace views { // Marks the passed |hwnd| as supporting mouse-wheel message rerouting. // We reroute the mouse wheel messages to such HWND when they are under the -// mouse pointer (but are not the active window). Callers must delete the -// returned object before the window is destroyed (see ScopedProp for details). -app::win::ScopedProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); +// mouse pointer (but are not the active window). Callers own the returned +// object. +app::ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // Forwards mouse wheel messages to the window under it. // Windows sends mouse wheel messages to the currently active window. -- cgit v1.1