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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 } | 212 } |
213 if (!destroyed) | 213 if (!destroyed) |
214 destroyed_ = NULL; | 214 destroyed_ = NULL; |
215 | 215 |
216 CheckWindowCreated(hwnd_); | 216 CheckWindowCreated(hwnd_); |
217 | 217 |
218 // The window procedure should have set the data for us. | 218 // The window procedure should have set the data for us. |
219 CHECK_EQ(this, GetWindowUserData(hwnd)); | 219 CHECK_EQ(this, GetWindowUserData(hwnd)); |
220 } | 220 } |
221 | 221 |
222 void WindowImpl::Destroy() { | |
Ben Goodger (Google)
2014/01/14 21:48:03
you actually can't rely on people calling this fun
| |
223 DestroyWindow(hwnd()); | |
224 hwnd_ = NULL; | |
Ben Goodger (Google)
2014/01/14 21:48:03
... and so this should be set in a handler for WM_
danakj
2014/01/14 21:58:41
Oh I see. The handler for WM_NCDESTROY appears to
| |
225 } | |
226 | |
222 HICON WindowImpl::GetDefaultWindowIcon() const { | 227 HICON WindowImpl::GetDefaultWindowIcon() const { |
223 return NULL; | 228 return NULL; |
224 } | 229 } |
225 | 230 |
226 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { | 231 LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { |
227 LRESULT result = 0; | 232 LRESULT result = 0; |
228 | 233 |
229 // Handle the message if it's in our message map; otherwise, let the system | 234 // Handle the message if it's in our message map; otherwise, let the system |
230 // handle it. | 235 // handle it. |
231 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) | 236 if (!ProcessWindowMessage(hwnd_, message, w_param, l_param, result)) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 return window->OnWndProc(message, w_param, l_param); | 268 return window->OnWndProc(message, w_param, l_param); |
264 } | 269 } |
265 | 270 |
266 ATOM WindowImpl::GetWindowClassAtom() { | 271 ATOM WindowImpl::GetWindowClassAtom() { |
267 HICON icon = GetDefaultWindowIcon(); | 272 HICON icon = GetDefaultWindowIcon(); |
268 ClassInfo class_info(initial_class_style(), icon); | 273 ClassInfo class_info(initial_class_style(), icon); |
269 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); | 274 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); |
270 } | 275 } |
271 | 276 |
272 } // namespace gfx | 277 } // namespace gfx |
OLD | NEW |