OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // NOTE: This code is a legacy utility API for partners to check whether | 5 // NOTE: This code is a legacy utility API for partners to check whether |
6 // Chrome can be installed and launched. Recent updates are being made | 6 // Chrome can be installed and launched. Recent updates are being made |
7 // to add new functionality. These updates use code from Chromium, the old | 7 // to add new functionality. These updates use code from Chromium, the old |
8 // coded against the win32 api directly. If you have an itch to shave a | 8 // coded against the win32 api directly. If you have an itch to shave a |
9 // yak, feel free to re-write the old code too. | 9 // yak, feel free to re-write the old code too. |
10 | 10 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 } | 496 } |
497 ::LocalFree(exp_proc_sid); | 497 ::LocalFree(exp_proc_sid); |
498 } | 498 } |
499 | 499 |
500 ::LocalFree(curr_proc_sid); | 500 ::LocalFree(curr_proc_sid); |
501 if (!impersonation_success) { | 501 if (!impersonation_success) { |
502 return false; | 502 return false; |
503 } | 503 } |
504 } | 504 } |
505 | 505 |
| 506 CommandLine chrome_command(chrome_exe_path); |
| 507 |
506 bool ret = false; | 508 bool ret = false; |
507 ScopedComPtr<IProcessLauncher> ipl; | 509 ScopedComPtr<IProcessLauncher> ipl; |
508 if (SUCCEEDED(ipl.CreateInstance(__uuidof(ProcessLauncherClass), | 510 if (SUCCEEDED(ipl.CreateInstance(__uuidof(ProcessLauncherClass), |
509 NULL, | 511 NULL, |
510 CLSCTX_LOCAL_SERVER))) { | 512 CLSCTX_LOCAL_SERVER))) { |
511 if (SUCCEEDED(ipl->LaunchCmdLine(chrome_exe_path.value().c_str()))) | 513 if (SUCCEEDED(ipl->LaunchCmdLine( |
| 514 chrome_command.GetCommandLineString().c_str()))) |
512 ret = true; | 515 ret = true; |
513 ipl.Release(); | 516 ipl.Release(); |
514 } else { | 517 } else { |
515 // Couldn't get Omaha's process launcher, Omaha may not be installed at | 518 // Couldn't get Omaha's process launcher, Omaha may not be installed at |
516 // system level. Try just running Chrome instead. | 519 // system level. Try just running Chrome instead. |
517 ret = base::LaunchProcess(chrome_exe_path.value(), | 520 ret = base::LaunchProcess(chrome_command.GetCommandLineString(), |
518 base::LaunchOptions(), | 521 base::LaunchOptions(), |
519 NULL); | 522 NULL); |
520 } | 523 } |
521 | 524 |
522 if (impersonation_success) | 525 if (impersonation_success) |
523 ::RevertToSelf(); | 526 ::RevertToSelf(); |
524 return ret; | 527 return ret; |
525 } | 528 } |
526 | 529 |
527 BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, | 530 BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 key.WriteValue(kRelaunchAllowedAfterValue, | 789 key.WriteValue(kRelaunchAllowedAfterValue, |
787 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS || | 790 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS || |
788 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { | 791 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { |
789 if (error_code) | 792 if (error_code) |
790 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; | 793 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; |
791 return FALSE; | 794 return FALSE; |
792 } | 795 } |
793 | 796 |
794 return TRUE; | 797 return TRUE; |
795 } | 798 } |
OLD | NEW |