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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 if (HasBeenReactivated()) { | 665 if (HasBeenReactivated()) { |
666 if (error_code) | 666 if (error_code) |
667 *error_code = REACTIVATE_ERROR_ALREADY_REACTIVATED; | 667 *error_code = REACTIVATE_ERROR_ALREADY_REACTIVATED; |
668 return FALSE; | 668 return FALSE; |
669 } | 669 } |
670 } | 670 } |
671 | 671 |
672 return TRUE; | 672 return TRUE; |
673 } | 673 } |
674 | 674 |
675 BOOL __stdcall ReactivateChrome(const wchar_t* brand_code, | 675 BOOL __stdcall ReactivateChrome(wchar_t* brand_code, |
676 int shell_mode, | 676 int shell_mode, |
677 DWORD* error_code) { | 677 DWORD* error_code) { |
678 BOOL result = FALSE; | 678 BOOL result = FALSE; |
679 if (CanOfferReactivation(brand_code, | 679 if (CanOfferReactivation(brand_code, |
680 shell_mode, | 680 shell_mode, |
681 error_code)) { | 681 error_code)) { |
682 if (SetReactivationBrandCode(brand_code, shell_mode)) { | 682 if (SetReactivationBrandCode(brand_code, shell_mode)) { |
683 // Currently set this as a best-effort thing. We return TRUE if | 683 // Currently set this as a best-effort thing. We return TRUE if |
684 // reactivation succeeded regardless of the experiment label result. | 684 // reactivation succeeded regardless of the experiment label result. |
685 SetReactivationExperimentLabels(brand_code, shell_mode); | 685 SetReactivationExperimentLabels(brand_code, shell_mode); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 key.WriteValue(kRelaunchAllowedAfterValue, | 789 key.WriteValue(kRelaunchAllowedAfterValue, |
790 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS || | 790 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS || |
791 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { | 791 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { |
792 if (error_code) | 792 if (error_code) |
793 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; | 793 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; |
794 return FALSE; | 794 return FALSE; |
795 } | 795 } |
796 | 796 |
797 return TRUE; | 797 return TRUE; |
798 } | 798 } |
OLD | NEW |