OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "base/win/scoped_handle.h" | 13 #include "base/win/scoped_handle.h" |
| 14 #include "base/win/wrapped_window_proc.h" |
14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/extensions/extensions_startup.h" | 16 #include "chrome/browser/extensions/extensions_startup.h" |
16 #include "chrome/browser/platform_util.h" | 17 #include "chrome/browser/platform_util.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/browser/ui/browser_init.h" | 20 #include "chrome/browser/ui/browser_init.h" |
20 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
21 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
22 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/common/result_codes.h" | 24 #include "chrome/common/result_codes.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // browser_main.cc we tolerate a second call which will do nothing. | 172 // browser_main.cc we tolerate a second call which will do nothing. |
172 bool ProcessSingleton::Create() { | 173 bool ProcessSingleton::Create() { |
173 DCHECK(!remote_window_); | 174 DCHECK(!remote_window_); |
174 if (window_) | 175 if (window_) |
175 return true; | 176 return true; |
176 | 177 |
177 HINSTANCE hinst = GetModuleHandle(NULL); | 178 HINSTANCE hinst = GetModuleHandle(NULL); |
178 | 179 |
179 WNDCLASSEX wc = {0}; | 180 WNDCLASSEX wc = {0}; |
180 wc.cbSize = sizeof(wc); | 181 wc.cbSize = sizeof(wc); |
181 wc.lpfnWndProc = ProcessSingleton::WndProcStatic; | 182 wc.lpfnWndProc = |
| 183 base::win::WrappedWindowProc<ProcessSingleton::WndProcStatic>; |
182 wc.hInstance = hinst; | 184 wc.hInstance = hinst; |
183 wc.lpszClassName = chrome::kMessageWindowClass; | 185 wc.lpszClassName = chrome::kMessageWindowClass; |
184 ATOM clazz = RegisterClassEx(&wc); | 186 ATOM clazz = RegisterClassEx(&wc); |
185 DCHECK(clazz); | 187 DCHECK(clazz); |
186 | 188 |
187 FilePath user_data_dir; | 189 FilePath user_data_dir; |
188 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 190 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
189 | 191 |
190 // Set the window's title to the path of our user data directory so other | 192 // Set the window's title to the path of our user data directory so other |
191 // Chrome instances can decide if they should forward to us or not. | 193 // Chrome instances can decide if they should forward to us or not. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 switch (message) { | 306 switch (message) { |
305 case WM_COPYDATA: | 307 case WM_COPYDATA: |
306 return OnCopyData(reinterpret_cast<HWND>(wparam), | 308 return OnCopyData(reinterpret_cast<HWND>(wparam), |
307 reinterpret_cast<COPYDATASTRUCT*>(lparam)); | 309 reinterpret_cast<COPYDATASTRUCT*>(lparam)); |
308 default: | 310 default: |
309 break; | 311 break; |
310 } | 312 } |
311 | 313 |
312 return ::DefWindowProc(hwnd, message, wparam, lparam); | 314 return ::DefWindowProc(hwnd, message, wparam, lparam); |
313 } | 315 } |
OLD | NEW |