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

Unified Diff: content/shell/shell_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.cc ('k') | remoting/host/host_service_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_win.cc
diff --git a/content/shell/shell_win.cc b/content/shell/shell_win.cc
index 22543782fb52df6683da51ab259791092b518b95..3aeef3cafeb0f8935218d3079666940d72be0dda 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,
« no previous file with comments | « content/browser/system_message_window_win.cc ('k') | remoting/host/host_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698