OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/win/message_window.h" | 5 #include "base/win/message_window.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/win/current_module.h" | 10 #include "base/win/current_module.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 ATOM atom() { return atom_; } | 25 ATOM atom() { return atom_; } |
26 HINSTANCE instance() { return instance_; } | 26 HINSTANCE instance() { return instance_; } |
27 | 27 |
28 private: | 28 private: |
29 ATOM atom_; | 29 ATOM atom_; |
30 HINSTANCE instance_; | 30 HINSTANCE instance_; |
31 | 31 |
32 DISALLOW_COPY_AND_ASSIGN(WindowClass); | 32 DISALLOW_COPY_AND_ASSIGN(WindowClass); |
33 }; | 33 }; |
34 | 34 |
35 static LazyInstance<MessageWindow::WindowClass> g_window_class = | 35 static LazyInstance<MessageWindow::WindowClass>::DestructorAtExit |
36 LAZY_INSTANCE_INITIALIZER; | 36 g_window_class = LAZY_INSTANCE_INITIALIZER; |
37 | 37 |
38 MessageWindow::WindowClass::WindowClass() | 38 MessageWindow::WindowClass::WindowClass() |
39 : atom_(0), instance_(CURRENT_MODULE()) { | 39 : atom_(0), instance_(CURRENT_MODULE()) { |
40 WNDCLASSEX window_class; | 40 WNDCLASSEX window_class; |
41 window_class.cbSize = sizeof(window_class); | 41 window_class.cbSize = sizeof(window_class); |
42 window_class.style = 0; | 42 window_class.style = 0; |
43 window_class.lpfnWndProc = &base::win::WrappedWindowProc<WindowProc>; | 43 window_class.lpfnWndProc = &base::win::WrappedWindowProc<WindowProc>; |
44 window_class.cbClsExtra = 0; | 44 window_class.cbClsExtra = 0; |
45 window_class.cbWndExtra = 0; | 45 window_class.cbWndExtra = 0; |
46 window_class.hInstance = instance_; | 46 window_class.hInstance = instance_; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 LRESULT message_result; | 156 LRESULT message_result; |
157 if (self->message_callback_.Run(message, wparam, lparam, &message_result)) | 157 if (self->message_callback_.Run(message, wparam, lparam, &message_result)) |
158 return message_result; | 158 return message_result; |
159 } | 159 } |
160 | 160 |
161 return DefWindowProc(hwnd, message, wparam, lparam); | 161 return DefWindowProc(hwnd, message, wparam, lparam); |
162 } | 162 } |
163 | 163 |
164 } // namespace win | 164 } // namespace win |
165 } // namespace base | 165 } // namespace base |
OLD | NEW |