| 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 <list> | 5 #include <list> |
| 6 | 6 |
| 7 #include "base/singleton.h" | 7 #include "base/singleton.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/window_impl.h" | 9 #include "base/window_impl.h" |
| 10 #include "base/win_util.h" | 10 #include "base/win_util.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 HICON WindowImpl::GetDefaultWindowIcon() const { | 148 HICON WindowImpl::GetDefaultWindowIcon() const { |
| 149 return NULL; | 149 return NULL; |
| 150 } | 150 } |
| 151 | 151 |
| 152 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { | 152 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { |
| 153 LRESULT result = 0; | 153 LRESULT result = 0; |
| 154 | 154 |
| 155 // Handle the message if it's in our message map; otherwise, let the system | 155 // Handle the message if it's in our message map; otherwise, let the system |
| 156 // handle it. | 156 // handle it. |
| 157 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) | 157 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) |
| 158 result = DefWindowProc(hwnd_, message, w_param, l_param); | 158 result = DefWindowProc(hwnd_, message, w_param, l_param); |
| 159 | |
| 160 if (message == WM_NCDESTROY) { | |
| 161 // Notify the subclass that this is the last message before the window | |
| 162 // is destroyed. | |
| 163 OnFinalMessage(hwnd_); | |
| 164 hwnd_ = NULL; | |
| 165 } | |
| 166 | 159 |
| 167 return result; | 160 return result; |
| 168 } | 161 } |
| 169 | 162 |
| 170 // static | 163 // static |
| 171 LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd, | 164 LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd, |
| 172 UINT message, | 165 UINT message, |
| 173 WPARAM w_param, | 166 WPARAM w_param, |
| 174 LPARAM l_param) { | 167 LPARAM l_param) { |
| 175 if (message == WM_NCCREATE) { | 168 if (message == WM_NCCREATE) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 class_ex.hIconSm = class_ex.hIcon; | 204 class_ex.hIconSm = class_ex.hIcon; |
| 212 ATOM atom = RegisterClassEx(&class_ex); | 205 ATOM atom = RegisterClassEx(&class_ex); |
| 213 DCHECK(atom); | 206 DCHECK(atom); |
| 214 | 207 |
| 215 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom); | 208 Singleton<ClassRegistrar>()->RegisterClass(class_info, name, atom); |
| 216 | 209 |
| 217 return name; | 210 return name; |
| 218 } | 211 } |
| 219 | 212 |
| 220 } // namespace base | 213 } // namespace base |
| OLD | NEW |