OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/window_impl.h" | 5 #include "ui/base/win/window_impl.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 return window->OnWndProc(message, w_param, l_param); | 191 return window->OnWndProc(message, w_param, l_param); |
192 } | 192 } |
193 | 193 |
194 std::wstring WindowImpl::GetWindowClassName() { | 194 std::wstring WindowImpl::GetWindowClassName() { |
195 ClassInfo class_info(initial_class_style()); | 195 ClassInfo class_info(initial_class_style()); |
196 std::wstring name; | 196 std::wstring name; |
197 if (ClassRegistrar::GetInstance()->RetrieveClassName(class_info, &name)) | 197 if (ClassRegistrar::GetInstance()->RetrieveClassName(class_info, &name)) |
198 return name; | 198 return name; |
199 | 199 |
200 // No class found, need to register one. | 200 // No class found, need to register one. |
201 WNDCLASSEX class_ex; | 201 WNDCLASSEX class_ex; |
Peter Kasting
2011/04/27 00:22:12
Nit: Does it make sense to use array initializer s
msw
2011/04/27 01:58:03
Done. Seems like no comments is the most comment p
| |
202 class_ex.cbSize = sizeof(WNDCLASSEX); | 202 class_ex.cbSize = sizeof(WNDCLASSEX); |
203 class_ex.style = class_info.style; | 203 class_ex.style = class_info.style; |
204 class_ex.lpfnWndProc = base::win::WrappedWindowProc<&WindowImpl::WndProc>; | 204 class_ex.lpfnWndProc = base::win::WrappedWindowProc<&WindowImpl::WndProc>; |
205 class_ex.cbClsExtra = 0; | 205 class_ex.cbClsExtra = 0; |
206 class_ex.cbWndExtra = 0; | 206 class_ex.cbWndExtra = 0; |
207 class_ex.hInstance = NULL; | 207 class_ex.hInstance = NULL; |
208 class_ex.hIcon = GetDefaultWindowIcon(); | 208 class_ex.hIcon = GetDefaultWindowIcon(); |
209 class_ex.hCursor = LoadCursor(NULL, IDC_ARROW); | 209 class_ex.hCursor = NULL; |
210 class_ex.hbrBackground = reinterpret_cast<HBRUSH>(class_info.background + 1); | 210 class_ex.hbrBackground = reinterpret_cast<HBRUSH>(class_info.background + 1); |
211 class_ex.lpszMenuName = NULL; | 211 class_ex.lpszMenuName = NULL; |
212 class_ex.lpszClassName = name.c_str(); | 212 class_ex.lpszClassName = name.c_str(); |
213 class_ex.hIconSm = class_ex.hIcon; | 213 class_ex.hIconSm = class_ex.hIcon; |
214 ATOM atom = RegisterClassEx(&class_ex); | 214 ATOM atom = RegisterClassEx(&class_ex); |
215 CHECK(atom) << GetLastError(); | 215 CHECK(atom) << GetLastError(); |
216 | 216 |
217 ClassRegistrar::GetInstance()->RegisterClass(class_info, name, atom); | 217 ClassRegistrar::GetInstance()->RegisterClass(class_info, name, atom); |
218 | 218 |
219 return name; | 219 return name; |
220 } | 220 } |
221 | 221 |
222 } // namespace ui | 222 } // namespace ui |
OLD | NEW |