| 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 | |
| 233 // Handle the message if it's in our message map; otherwise, let the system | 229 // Handle the message if it's in our message map; otherwise, let the system |
| 234 // handle it. | 230 // handle it. |
| 235 if (!ProcessWindowMessage(hwnd, message, w_param, l_param, result)) | 231 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) |
| 236 result = DefWindowProc(hwnd, message, w_param, l_param); | 232 result = DefWindowProc(hwnd_, message, w_param, l_param); |
| 237 | 233 |
| 238 return result; | 234 return result; |
| 239 } | 235 } |
| 240 | 236 |
| 241 void WindowImpl::ClearUserData() { | 237 void WindowImpl::ClearUserData() { |
| 242 if (::IsWindow(hwnd_)) | 238 if (::IsWindow(hwnd_)) |
| 243 gfx::SetWindowUserData(hwnd_, NULL); | 239 gfx::SetWindowUserData(hwnd_, NULL); |
| 244 } | 240 } |
| 245 | 241 |
| 246 // static | 242 // static |
| (...skipping 20 matching lines...) Expand all Loading... |
| 267 return window->OnWndProc(message, w_param, l_param); | 263 return window->OnWndProc(message, w_param, l_param); |
| 268 } | 264 } |
| 269 | 265 |
| 270 ATOM WindowImpl::GetWindowClassAtom() { | 266 ATOM WindowImpl::GetWindowClassAtom() { |
| 271 HICON icon = GetDefaultWindowIcon(); | 267 HICON icon = GetDefaultWindowIcon(); |
| 272 ClassInfo class_info(initial_class_style(), icon); | 268 ClassInfo class_info(initial_class_style(), icon); |
| 273 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); | 269 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); |
| 274 } | 270 } |
| 275 | 271 |
| 276 } // namespace gfx | 272 } // namespace gfx |
| OLD | NEW |