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

Side by Side Diff: chrome/browser/browser_main_win.cc

Issue 6526040: CommandLine refactoring and cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits, merge changes. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/command_line_unittest.cc ('k') | chrome/browser/process_info_snapshot_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // Get the function pointer for RegisterApplicationRestart. 223 // Get the function pointer for RegisterApplicationRestart.
224 RegisterApplicationRestartProc register_application_restart = 224 RegisterApplicationRestartProc register_application_restart =
225 static_cast<RegisterApplicationRestartProc>( 225 static_cast<RegisterApplicationRestartProc>(
226 library.GetFunctionPointer("RegisterApplicationRestart")); 226 library.GetFunctionPointer("RegisterApplicationRestart"));
227 if (!register_application_restart) 227 if (!register_application_restart)
228 return false; 228 return false;
229 229
230 // The Windows Restart Manager expects a string of command line flags only, 230 // The Windows Restart Manager expects a string of command line flags only,
231 // without the program. 231 // without the program.
232 CommandLine command_line(CommandLine::NO_PROGRAM); 232 CommandLine command_line(CommandLine::NO_PROGRAM);
233 command_line.AppendSwitches(parsed_command_line); 233 command_line.AppendArguments(parsed_command_line, false);
234 command_line.AppendArgs(parsed_command_line);
235 // Ensure restore last session is set. 234 // Ensure restore last session is set.
236 if (!command_line.HasSwitch(switches::kRestoreLastSession)) 235 if (!command_line.HasSwitch(switches::kRestoreLastSession))
237 command_line.AppendSwitch(switches::kRestoreLastSession); 236 command_line.AppendSwitch(switches::kRestoreLastSession);
238 237
239 // Restart Chrome if the computer is restarted as the result of an update. 238 // Restart Chrome if the computer is restarted as the result of an update.
240 // This could be extended to handle crashes, hangs, and patches. 239 // This could be extended to handle crashes, hangs, and patches.
241 HRESULT hr = register_application_restart( 240 HRESULT hr = register_application_restart(
242 command_line.command_line_string().c_str(), 241 command_line.command_line_string().c_str(),
243 RESTART_NO_CRASH | RESTART_NO_HANG | RESTART_NO_PATCH); 242 RESTART_NO_CRASH | RESTART_NO_HANG | RESTART_NO_PATCH);
244 DCHECK(SUCCEEDED(hr)) << "RegisterApplicationRestart failed."; 243 DCHECK(SUCCEEDED(hr)) << "RegisterApplicationRestart failed.";
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 crypto::EnsureNSPRInit(); 352 crypto::EnsureNSPRInit();
354 } 353 }
355 } 354 }
356 }; 355 };
357 356
358 // static 357 // static
359 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( 358 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts(
360 const MainFunctionParams& parameters) { 359 const MainFunctionParams& parameters) {
361 return new BrowserMainPartsWin(parameters); 360 return new BrowserMainPartsWin(parameters);
362 } 361 }
OLDNEW
« no previous file with comments | « base/command_line_unittest.cc ('k') | chrome/browser/process_info_snapshot_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698