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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
6 #include "chrome/browser/browser_main_win.h" | 6 #include "chrome/browser/browser_main_win.h" |
7 | 7 |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // Get the function pointer for RegisterApplicationRestart. | 190 // Get the function pointer for RegisterApplicationRestart. |
191 RegisterApplicationRestartProc register_application_restart = | 191 RegisterApplicationRestartProc register_application_restart = |
192 static_cast<RegisterApplicationRestartProc>( | 192 static_cast<RegisterApplicationRestartProc>( |
193 library.GetFunctionPointer("RegisterApplicationRestart")); | 193 library.GetFunctionPointer("RegisterApplicationRestart")); |
194 if (!register_application_restart) | 194 if (!register_application_restart) |
195 return false; | 195 return false; |
196 | 196 |
197 // The Windows Restart Manager expects a string of command line flags only, | 197 // The Windows Restart Manager expects a string of command line flags only, |
198 // without the program. | 198 // without the program. |
199 CommandLine command_line(CommandLine::NO_PROGRAM); | 199 CommandLine command_line(CommandLine::NO_PROGRAM); |
200 command_line.AppendSwitches(parsed_command_line); | 200 command_line.AppendArguments(parsed_command_line, false); |
201 command_line.AppendArgs(parsed_command_line); | |
202 // Ensure restore last session is set. | 201 // Ensure restore last session is set. |
203 if (!command_line.HasSwitch(switches::kRestoreLastSession)) | 202 if (!command_line.HasSwitch(switches::kRestoreLastSession)) |
204 command_line.AppendSwitch(switches::kRestoreLastSession); | 203 command_line.AppendSwitch(switches::kRestoreLastSession); |
205 | 204 |
206 // Restart Chrome if the computer is restarted as the result of an update. | 205 // Restart Chrome if the computer is restarted as the result of an update. |
207 // This could be extended to handle crashes, hangs, and patches. | 206 // This could be extended to handle crashes, hangs, and patches. |
208 HRESULT hr = register_application_restart( | 207 HRESULT hr = register_application_restart( |
209 command_line.command_line_string().c_str(), | 208 command_line.command_line_string().c_str(), |
210 RESTART_NO_CRASH | RESTART_NO_HANG | RESTART_NO_PATCH); | 209 RESTART_NO_CRASH | RESTART_NO_HANG | RESTART_NO_PATCH); |
211 DCHECK(SUCCEEDED(hr)) << "RegisterApplicationRestart failed."; | 210 DCHECK(SUCCEEDED(hr)) << "RegisterApplicationRestart failed."; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 crypto::EnsureNSPRInit(); | 312 crypto::EnsureNSPRInit(); |
314 } | 313 } |
315 } | 314 } |
316 }; | 315 }; |
317 | 316 |
318 // static | 317 // static |
319 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 318 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
320 const MainFunctionParams& parameters) { | 319 const MainFunctionParams& parameters) { |
321 return new BrowserMainPartsWin(parameters); | 320 return new BrowserMainPartsWin(parameters); |
322 } | 321 } |
OLD | NEW |