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/gfx/win/window_impl.h" | 5 #include "ui/gfx/win/window_impl.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 CHECK_EQ(this, GetWindowUserData(hwnd)); | 219 CHECK_EQ(this, GetWindowUserData(hwnd)); |
220 } | 220 } |
221 | 221 |
222 HICON WindowImpl::GetDefaultWindowIcon() const { | 222 HICON WindowImpl::GetDefaultWindowIcon() const { |
223 return NULL; | 223 return NULL; |
224 } | 224 } |
225 | 225 |
226 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { | 226 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { |
227 LRESULT result = 0; | 227 LRESULT result = 0; |
228 | 228 |
| 229 HWND hwnd = hwnd_; |
| 230 if (message == WM_NCDESTROY) |
| 231 hwnd_ = NULL; |
| 232 |
229 // Handle the message if it's in our message map; otherwise, let the system | 233 // Handle the message if it's in our message map; otherwise, let the system |
230 // handle it. | 234 // handle it. |
231 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) | 235 if (!ProcessWindowMessage(hwnd, message, w_param, l_param, result)) |
232 result = DefWindowProc(hwnd_, message, w_param, l_param); | 236 result = DefWindowProc(hwnd, message, w_param, l_param); |
233 | 237 |
234 return result; | 238 return result; |
235 } | 239 } |
236 | 240 |
237 void WindowImpl::ClearUserData() { | 241 void WindowImpl::ClearUserData() { |
238 if (::IsWindow(hwnd_)) | 242 if (::IsWindow(hwnd_)) |
239 gfx::SetWindowUserData(hwnd_, NULL); | 243 gfx::SetWindowUserData(hwnd_, NULL); |
240 } | 244 } |
241 | 245 |
242 // static | 246 // static |
(...skipping 20 matching lines...) Expand all Loading... |
263 return window->OnWndProc(message, w_param, l_param); | 267 return window->OnWndProc(message, w_param, l_param); |
264 } | 268 } |
265 | 269 |
266 ATOM WindowImpl::GetWindowClassAtom() { | 270 ATOM WindowImpl::GetWindowClassAtom() { |
267 HICON icon = GetDefaultWindowIcon(); | 271 HICON icon = GetDefaultWindowIcon(); |
268 ClassInfo class_info(initial_class_style(), icon); | 272 ClassInfo class_info(initial_class_style(), icon); |
269 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); | 273 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); |
270 } | 274 } |
271 | 275 |
272 } // namespace gfx | 276 } // namespace gfx |
OLD | NEW |