OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/win/hwnd_subclass.h" | 5 #include "ui/base/win/hwnd_subclass.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 reinterpret_cast<ui::HWNDSubclass*>( | 22 reinterpret_cast<ui::HWNDSubclass*>( |
23 ui::ViewProp::GetValue(hwnd, kHWNDSubclassKey)); | 23 ui::ViewProp::GetValue(hwnd, kHWNDSubclassKey)); |
24 return wrapped_wnd_proc ? wrapped_wnd_proc->OnWndProc(hwnd, | 24 return wrapped_wnd_proc ? wrapped_wnd_proc->OnWndProc(hwnd, |
25 message, | 25 message, |
26 w_param, | 26 w_param, |
27 l_param) | 27 l_param) |
28 : DefWindowProc(hwnd, message, w_param, l_param); | 28 : DefWindowProc(hwnd, message, w_param, l_param); |
29 } | 29 } |
30 | 30 |
31 WNDPROC GetCurrentWndProc(HWND target) { | 31 WNDPROC GetCurrentWndProc(HWND target) { |
32 return reinterpret_cast<WNDPROC>(GetWindowLong(target, GWL_WNDPROC)); | 32 return reinterpret_cast<WNDPROC>(GetWindowLongPtr(target, GWLP_WNDPROC)); |
33 } | 33 } |
34 | 34 |
35 } // namespace | 35 } // namespace |
36 | 36 |
37 namespace ui { | 37 namespace ui { |
38 | 38 |
39 // Singleton factory that creates and manages the lifetime of all | 39 // Singleton factory that creates and manages the lifetime of all |
40 // ui::HWNDSubclass objects. | 40 // ui::HWNDSubclass objects. |
41 class HWNDSubclass::HWNDSubclassFactory { | 41 class HWNDSubclass::HWNDSubclassFactory { |
42 public: | 42 public: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // In most cases, |original_wnd_proc_| will take care of calling | 129 // In most cases, |original_wnd_proc_| will take care of calling |
130 // DefWindowProc. | 130 // DefWindowProc. |
131 return CallWindowProc(original_wnd_proc_, hwnd, message, w_param, l_param); | 131 return CallWindowProc(original_wnd_proc_, hwnd, message, w_param, l_param); |
132 } | 132 } |
133 | 133 |
134 HWNDMessageFilter::~HWNDMessageFilter() { | 134 HWNDMessageFilter::~HWNDMessageFilter() { |
135 HWNDSubclass::RemoveFilterFromAllTargets(this); | 135 HWNDSubclass::RemoveFilterFromAllTargets(this); |
136 } | 136 } |
137 | 137 |
138 } // namespace ui | 138 } // namespace ui |
OLD | NEW |