| 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" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "ui/gfx/win/dpi.h" | |
| 13 #include "ui/gfx/win/hwnd_util.h" | 12 #include "ui/gfx/win/hwnd_util.h" |
| 14 | 13 |
| 15 namespace { | 14 namespace { |
| 16 const char kHWNDSubclassKey[] = "__UI_BASE_WIN_HWND_SUBCLASS_PROC__"; | 15 const char kHWNDSubclassKey[] = "__UI_BASE_WIN_HWND_SUBCLASS_PROC__"; |
| 17 | 16 |
| 18 LRESULT CALLBACK WndProc(HWND hwnd, | 17 LRESULT CALLBACK WndProc(HWND hwnd, |
| 19 UINT message, | 18 UINT message, |
| 20 WPARAM w_param, | 19 WPARAM w_param, |
| 21 LPARAM l_param) { | 20 LPARAM l_param) { |
| 22 ui::HWNDSubclass* wrapped_wnd_proc = | 21 ui::HWNDSubclass* wrapped_wnd_proc = |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // In most cases, |original_wnd_proc_| will take care of calling | 160 // In most cases, |original_wnd_proc_| will take care of calling |
| 162 // DefWindowProc. | 161 // DefWindowProc. |
| 163 return CallWindowProc(original_wnd_proc_, hwnd, message, w_param, l_param); | 162 return CallWindowProc(original_wnd_proc_, hwnd, message, w_param, l_param); |
| 164 } | 163 } |
| 165 | 164 |
| 166 HWNDMessageFilter::~HWNDMessageFilter() { | 165 HWNDMessageFilter::~HWNDMessageFilter() { |
| 167 HWNDSubclass::RemoveFilterFromAllTargets(this); | 166 HWNDSubclass::RemoveFilterFromAllTargets(this); |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace ui | 169 } // namespace ui |
| OLD | NEW |