OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/win/window_impl.h" | 5 #include "app/win/window_impl.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 DCHECK(hwnd_); | 145 DCHECK(hwnd_); |
146 | 146 |
147 // The window procedure should have set the data for us. | 147 // The window procedure should have set the data for us. |
148 DCHECK(win_util::GetWindowUserData(hwnd_) == this); | 148 DCHECK(win_util::GetWindowUserData(hwnd_) == this); |
149 } | 149 } |
150 | 150 |
151 HICON WindowImpl::GetDefaultWindowIcon() const { | 151 HICON WindowImpl::GetDefaultWindowIcon() const { |
152 return NULL; | 152 return NULL; |
153 } | 153 } |
154 | 154 |
| 155 // static |
| 156 bool WindowImpl::IsWindowImpl(HWND hwnd) { |
| 157 wchar_t tmp[128]; |
| 158 if (!::GetClassName(hwnd, tmp, 128)) |
| 159 return false; |
| 160 |
| 161 std::wstring class_name(tmp); |
| 162 return class_name.find(kBaseClassName) == 0; |
| 163 } |
| 164 |
155 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { | 165 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { |
156 LRESULT result = 0; | 166 LRESULT result = 0; |
157 | 167 |
158 // Handle the message if it's in our message map; otherwise, let the system | 168 // Handle the message if it's in our message map; otherwise, let the system |
159 // handle it. | 169 // handle it. |
160 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) | 170 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) |
161 result = DefWindowProc(hwnd_, message, w_param, l_param); | 171 result = DefWindowProc(hwnd_, message, w_param, l_param); |
162 | 172 |
163 return result; | 173 return result; |
164 } | 174 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 class_ex.hIconSm = class_ex.hIcon; | 217 class_ex.hIconSm = class_ex.hIcon; |
208 ATOM atom = RegisterClassEx(&class_ex); | 218 ATOM atom = RegisterClassEx(&class_ex); |
209 DCHECK(atom); | 219 DCHECK(atom); |
210 | 220 |
211 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom); | 221 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom); |
212 | 222 |
213 return name; | 223 return name; |
214 } | 224 } |
215 | 225 |
216 } // namespace app | 226 } // namespace app |
OLD | NEW |