Chromium Code Reviews| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 LPARAM l_param) { | 285 LPARAM l_param) { |
| 286 if (message == WM_NCCREATE) { | 286 if (message == WM_NCCREATE) { |
| 287 CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(l_param); | 287 CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(l_param); |
| 288 WindowImpl* window = reinterpret_cast<WindowImpl*>(cs->lpCreateParams); | 288 WindowImpl* window = reinterpret_cast<WindowImpl*>(cs->lpCreateParams); |
| 289 DCHECK(window); | 289 DCHECK(window); |
| 290 gfx::SetWindowUserData(hwnd, window); | 290 gfx::SetWindowUserData(hwnd, window); |
| 291 window->hwnd_ = hwnd; | 291 window->hwnd_ = hwnd; |
| 292 window->got_create_ = true; | 292 window->got_create_ = true; |
| 293 if (hwnd) | 293 if (hwnd) |
| 294 window->got_valid_hwnd_ = true; | 294 window->got_valid_hwnd_ = true; |
| 295 return TRUE; | |
| 296 } | 295 } |
| 297 | 296 |
| 298 WindowImpl* window = reinterpret_cast<WindowImpl*>(GetWindowUserData(hwnd)); | 297 WindowImpl* window = reinterpret_cast<WindowImpl*>(GetWindowUserData(hwnd)); |
|
sky
2016/12/14 02:42:41
This isn't necessary for the if case, maybe move d
robliao
2016/12/14 18:50:19
While that is true, this seems more readable and G
sky
2016/12/14 18:54:24
I personally think it's clearer overall to not do
robliao
2016/12/14 19:03:18
Done.
The main reason I don't like setting it to
| |
| 299 if (!window) | 298 if (!window) |
| 300 return 0; | 299 return 0; |
| 301 | 300 |
| 302 return window->OnWndProc(message, w_param, l_param); | 301 return window->OnWndProc(message, w_param, l_param); |
| 303 } | 302 } |
| 304 | 303 |
| 305 ATOM WindowImpl::GetWindowClassAtom() { | 304 ATOM WindowImpl::GetWindowClassAtom() { |
| 306 HICON icon = GetDefaultWindowIcon(); | 305 HICON icon = GetDefaultWindowIcon(); |
| 307 HICON small_icon = GetSmallWindowIcon(); | 306 HICON small_icon = GetSmallWindowIcon(); |
| 308 ClassInfo class_info(initial_class_style(), icon, small_icon); | 307 ClassInfo class_info(initial_class_style(), icon, small_icon); |
| 309 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); | 308 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); |
| 310 } | 309 } |
| 311 | 310 |
| 312 } // namespace gfx | 311 } // namespace gfx |
| OLD | NEW |