| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 base::CommandLine chrome_command(chrome_exe_path); | 486 base::CommandLine chrome_command(chrome_exe_path); |
| 487 | 487 |
| 488 bool ret = false; | 488 bool ret = false; |
| 489 ScopedComPtr<IProcessLauncher> ipl; | 489 ScopedComPtr<IProcessLauncher> ipl; |
| 490 if (SUCCEEDED(ipl.CreateInstance(__uuidof(ProcessLauncherClass), | 490 if (SUCCEEDED(ipl.CreateInstance(__uuidof(ProcessLauncherClass), |
| 491 NULL, | 491 NULL, |
| 492 CLSCTX_LOCAL_SERVER))) { | 492 CLSCTX_LOCAL_SERVER))) { |
| 493 if (SUCCEEDED(ipl->LaunchCmdLine( | 493 if (SUCCEEDED(ipl->LaunchCmdLine( |
| 494 chrome_command.GetCommandLineString().c_str()))) | 494 chrome_command.GetCommandLineString().c_str()))) |
| 495 ret = true; | 495 ret = true; |
| 496 ipl.Release(); | 496 ipl.Reset(); |
| 497 } else { | 497 } else { |
| 498 // Couldn't get Omaha's process launcher, Omaha may not be installed at | 498 // Couldn't get Omaha's process launcher, Omaha may not be installed at |
| 499 // system level. Try just running Chrome instead. | 499 // system level. Try just running Chrome instead. |
| 500 ret = base::LaunchProcess(chrome_command.GetCommandLineString(), | 500 ret = base::LaunchProcess(chrome_command.GetCommandLineString(), |
| 501 base::LaunchOptions()).IsValid(); | 501 base::LaunchOptions()).IsValid(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 if (impersonation_success) | 504 if (impersonation_success) |
| 505 ::RevertToSelf(); | 505 ::RevertToSelf(); |
| 506 return ret; | 506 return ret; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 key.WriteValue(kRelaunchAllowedAfterValue, FormatDateOffsetByMonths(6)) != | 766 key.WriteValue(kRelaunchAllowedAfterValue, FormatDateOffsetByMonths(6)) != |
| 767 ERROR_SUCCESS || | 767 ERROR_SUCCESS || |
| 768 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { | 768 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { |
| 769 if (error_code) | 769 if (error_code) |
| 770 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; | 770 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; |
| 771 return FALSE; | 771 return FALSE; |
| 772 } | 772 } |
| 773 | 773 |
| 774 return TRUE; | 774 return TRUE; |
| 775 } | 775 } |
| OLD | NEW |