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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 NULL, | 512 NULL, |
513 CLSCTX_LOCAL_SERVER))) { | 513 CLSCTX_LOCAL_SERVER))) { |
514 if (SUCCEEDED(ipl->LaunchCmdLine( | 514 if (SUCCEEDED(ipl->LaunchCmdLine( |
515 chrome_command.GetCommandLineString().c_str()))) | 515 chrome_command.GetCommandLineString().c_str()))) |
516 ret = true; | 516 ret = true; |
517 ipl.Release(); | 517 ipl.Release(); |
518 } else { | 518 } else { |
519 // Couldn't get Omaha's process launcher, Omaha may not be installed at | 519 // Couldn't get Omaha's process launcher, Omaha may not be installed at |
520 // system level. Try just running Chrome instead. | 520 // system level. Try just running Chrome instead. |
521 ret = base::LaunchProcess(chrome_command.GetCommandLineString(), | 521 ret = base::LaunchProcess(chrome_command.GetCommandLineString(), |
522 base::LaunchOptions(), | 522 base::LaunchOptions()).IsValid(); |
523 NULL); | |
524 } | 523 } |
525 | 524 |
526 if (impersonation_success) | 525 if (impersonation_success) |
527 ::RevertToSelf(); | 526 ::RevertToSelf(); |
528 return ret; | 527 return ret; |
529 } | 528 } |
530 | 529 |
531 BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, | 530 BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, |
532 int y, | 531 int y, |
533 int width, | 532 int width, |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 key.WriteValue(kRelaunchAllowedAfterValue, | 789 key.WriteValue(kRelaunchAllowedAfterValue, |
791 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS || | 790 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS || |
792 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { | 791 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { |
793 if (error_code) | 792 if (error_code) |
794 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; | 793 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; |
795 return FALSE; | 794 return FALSE; |
796 } | 795 } |
797 | 796 |
798 return TRUE; | 797 return TRUE; |
799 } | 798 } |
OLD | NEW |