summaryrefslogtreecommitdiffstats
path: root/content/shell/shell_win.cc
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-09 20:38:18 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-09 20:38:18 +0000
commit7a66b99fbf5cd967ba12e643fc0072fc20514990 (patch)
treed4bec32782951f4c63a4aca99b655222017c6002 /content/shell/shell_win.cc
parentdecd4114476cb68ef734dd91cbea6d56c404bee5 (diff)
downloadchromium_src-7a66b99fbf5cd967ba12e643fc0072fc20514990.zip
chromium_src-7a66b99fbf5cd967ba12e643fc0072fc20514990.tar.gz
chromium_src-7a66b99fbf5cd967ba12e643fc0072fc20514990.tar.bz2
Added base::win::InitializeWindowClass() wrapper to make sure that window classes are properly associated with the modules containing their window procedures.
TEST=win,win_rel Review URL: https://chromiumcodereview.appspot.com/10315012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell_win.cc')
-rw-r--r--content/shell/shell_win.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/content/shell/shell_win.cc b/content/shell/shell_win.cc
index 2254378..3aeef3c 100644
--- a/content/shell/shell_win.cc
+++ b/content/shell/shell_win.cc
@@ -10,6 +10,7 @@
#include "base/string_piece.h"
#include "base/utf_string_conversions.h"
#include "base/win/resource_util.h"
+#include "base/win/wrapped_window_proc.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/shell/resource.h"
@@ -46,8 +47,6 @@ namespace content {
HINSTANCE Shell::instance_handle_;
void Shell::PlatformInitialize() {
- instance_handle_ = ::GetModuleHandle(NULL);
-
INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCtrlEx.dwICC = ICC_STANDARD_CLASSES;
@@ -190,21 +189,21 @@ void Shell::Close() {
}
ATOM Shell::RegisterWindowClass() {
- WNDCLASSEX wcex = {
- sizeof(WNDCLASSEX),
+ WNDCLASSEX window_class;
+ base::win::InitializeWindowClass(
+ kWindowClass,
+ &Shell::WndProc,
CS_HREDRAW | CS_VREDRAW,
- Shell::WndProc,
0,
0,
- instance_handle_,
- NULL,
LoadCursor(NULL, IDC_ARROW),
- 0,
+ NULL,
MAKEINTRESOURCE(IDC_CONTENTSHELL),
- kWindowClass,
NULL,
- };
- return RegisterClassEx(&wcex);
+ NULL,
+ &window_class);
+ instance_handle_ = window_class.hInstance;
+ return RegisterClassEx(&window_class);
}
LRESULT CALLBACK Shell::WndProc(HWND hwnd, UINT message, WPARAM wParam,