summaryrefslogtreecommitdiffstats
path: root/views/focus
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 18:47:05 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 18:47:05 +0000
commit28164cbf4787643ad22efc12b439ba0cff93cc63 (patch)
treedc6b1ecd04b34252755b6b6452859cb6ee6ad667 /views/focus
parent416ed618e916018bb154acd52fd39ca1198efd22 (diff)
downloadchromium_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/focus')
-rw-r--r--views/focus/focus_util_win.cc18
-rw-r--r--views/focus/focus_util_win.h10
2 files changed, 14 insertions, 14 deletions
diff --git a/views/focus/focus_util_win.cc b/views/focus/focus_util_win.cc
index 23172ad..266a891 100644
--- a/views/focus/focus_util_win.cc
+++ b/views/focus/focus_util_win.cc
@@ -6,26 +6,24 @@
#include <windowsx.h>
-#include "app/view_prop.h"
+#include "app/win/scoped_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 char* const kHWNDSupportMouseWheelRerouting =
- "__HWND_MW_REROUTE_OK";
+static const wchar_t* const kHWNDSupportMouseWheelRerouting =
+ L"__HWND_MW_REROUTE_OK";
static bool WindowSupportsRerouteMouseWheel(HWND window) {
while (GetWindowLong(window, GWL_STYLE) & WS_CHILD) {
if (!IsWindow(window))
break;
- if (reinterpret_cast<bool>(
- ViewProp::GetValue(window, kHWNDSupportMouseWheelRerouting))) {
+ if (reinterpret_cast<bool>(GetProp(window,
+ kHWNDSupportMouseWheelRerouting))) {
return true;
}
window = GetParent(window);
@@ -55,9 +53,9 @@ static bool CanRedirectMouseWheelFrom(HWND window) {
return true;
}
-ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd) {
- return new ViewProp(hwnd, kHWNDSupportMouseWheelRerouting,
- reinterpret_cast<HANDLE>(true));
+app::win::ScopedProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd) {
+ return new app::win::ScopedProp(hwnd, kHWNDSupportMouseWheelRerouting,
+ reinterpret_cast<HANDLE>(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 6394f5d..2c53c68 100644
--- a/views/focus/focus_util_win.h
+++ b/views/focus/focus_util_win.h
@@ -9,16 +9,18 @@
#include <windows.h>
namespace app {
-class ViewProp;
+namespace win {
+class ScopedProp;
+}
}
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 own the returned
-// object.
-app::ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd);
+// 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);
// Forwards mouse wheel messages to the window under it.
// Windows sends mouse wheel messages to the currently active window.