Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: ui/base/win/hwnd_subclass.cc

Issue 23769011: Move a bunch of windows stuff from ui/base/win to ui/gfx/win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moar bustage. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/win/hidden_window.cc ('k') | ui/base/win/hwnd_subclass_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/win/hwnd_util.h" 12 #include "ui/gfx/win/dpi.h"
13 #include "ui/gfx/dpi_win.h" 13 #include "ui/gfx/win/hwnd_util.h"
14 14
15 namespace { 15 namespace {
16 const char kHWNDSubclassKey[] = "__UI_BASE_WIN_HWND_SUBCLASS_PROC__"; 16 const char kHWNDSubclassKey[] = "__UI_BASE_WIN_HWND_SUBCLASS_PROC__";
17 17
18 LRESULT CALLBACK WndProc(HWND hwnd, 18 LRESULT CALLBACK WndProc(HWND hwnd,
19 UINT message, 19 UINT message,
20 WPARAM w_param, 20 WPARAM w_param,
21 LPARAM l_param) { 21 LPARAM l_param) {
22 ui::HWNDSubclass* wrapped_wnd_proc = 22 ui::HWNDSubclass* wrapped_wnd_proc =
23 reinterpret_cast<ui::HWNDSubclass*>( 23 reinterpret_cast<ui::HWNDSubclass*>(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 std::vector<HWNDMessageFilter*>::iterator it = 116 std::vector<HWNDMessageFilter*>::iterator it =
117 std::find(filters_.begin(), filters_.end(), filter); 117 std::find(filters_.begin(), filters_.end(), filter);
118 if (it != filters_.end()) 118 if (it != filters_.end())
119 filters_.erase(it); 119 filters_.erase(it);
120 } 120 }
121 121
122 HWNDSubclass::HWNDSubclass(HWND target) 122 HWNDSubclass::HWNDSubclass(HWND target)
123 : target_(target), 123 : target_(target),
124 original_wnd_proc_(GetCurrentWndProc(target)), 124 original_wnd_proc_(GetCurrentWndProc(target)),
125 prop_(target, kHWNDSubclassKey, this) { 125 prop_(target, kHWNDSubclassKey, this) {
126 ui::SetWindowProc(target_, &WndProc); 126 gfx::SetWindowProc(target_, &WndProc);
127 } 127 }
128 128
129 HWNDSubclass::~HWNDSubclass() { 129 HWNDSubclass::~HWNDSubclass() {
130 } 130 }
131 131
132 LRESULT HWNDSubclass::OnWndProc(HWND hwnd, 132 LRESULT HWNDSubclass::OnWndProc(HWND hwnd,
133 UINT message, 133 UINT message,
134 WPARAM w_param, 134 WPARAM w_param,
135 LPARAM l_param) { 135 LPARAM l_param) {
136 136
(...skipping 27 matching lines...) Expand all
164 // In most cases, |original_wnd_proc_| will take care of calling 164 // In most cases, |original_wnd_proc_| will take care of calling
165 // DefWindowProc. 165 // DefWindowProc.
166 return CallWindowProc(original_wnd_proc_, hwnd, message, w_param, l_param); 166 return CallWindowProc(original_wnd_proc_, hwnd, message, w_param, l_param);
167 } 167 }
168 168
169 HWNDMessageFilter::~HWNDMessageFilter() { 169 HWNDMessageFilter::~HWNDMessageFilter() {
170 HWNDSubclass::RemoveFilterFromAllTargets(this); 170 HWNDSubclass::RemoveFilterFromAllTargets(this);
171 } 171 }
172 172
173 } // namespace ui 173 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/win/hidden_window.cc ('k') | ui/base/win/hwnd_subclass_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698