Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: content/browser/system_message_window_win.cc

Issue 10315012: Added base::win::InitializeWindowClass() wrapper to make sure that window classes are properly asso… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback and rebased. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/system_message_window_win.h ('k') | content/shell/shell_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/system_message_window_win.cc
diff --git a/content/browser/system_message_window_win.cc b/content/browser/system_message_window_win.cc
index 347e717d27f5e84e408ef977f8ecec6adaa2c1ac..1f6fcb094922e1261836fc3e9c56ac39ca38288b 100644
--- a/content/browser/system_message_window_win.cc
+++ b/content/browser/system_message_window_win.cc
@@ -15,26 +15,25 @@ static const wchar_t* const WindowClassName = L"Chrome_SystemMessageWindow";
SystemMessageWindowWin::SystemMessageWindowWin() {
- HINSTANCE hinst = GetModuleHandle(NULL);
-
- WNDCLASSEX wc = {0};
- wc.cbSize = sizeof(wc);
- wc.lpfnWndProc =
- base::win::WrappedWindowProc<&SystemMessageWindowWin::WndProcThunk>;
- wc.hInstance = hinst;
- wc.lpszClassName = WindowClassName;
- ATOM clazz = RegisterClassEx(&wc);
+ WNDCLASSEX window_class;
+ base::win::InitializeWindowClass(
+ WindowClassName,
+ &base::win::WrappedWindowProc<SystemMessageWindowWin::WndProcThunk>,
+ 0, 0, 0, NULL, NULL, NULL, NULL, NULL,
+ &window_class);
+ instance_ = window_class.hInstance;
+ ATOM clazz = RegisterClassEx(&window_class);
DCHECK(clazz);
window_ = CreateWindow(WindowClassName,
- 0, 0, 0, 0, 0, 0, 0, 0, hinst, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, instance_, 0);
SetWindowLongPtr(window_, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
}
SystemMessageWindowWin::~SystemMessageWindowWin() {
if (window_) {
DestroyWindow(window_);
- UnregisterClass(WindowClassName, GetModuleHandle(NULL));
+ UnregisterClass(WindowClassName, instance_);
}
}
« no previous file with comments | « content/browser/system_message_window_win.h ('k') | content/shell/shell_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698