| 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 // This file defines specific implementation of BrowserDistribution class for | 5 // This file defines specific implementation of BrowserDistribution class for |
| 6 // Google Chrome. | 6 // Google Chrome. |
| 7 | 7 |
| 8 #include "chrome/installer/util/google_chrome_distribution.h" | 8 #include "chrome/installer/util/google_chrome_distribution.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/installer/util/installer_util_strings.h" | 30 #include "chrome/installer/util/installer_util_strings.h" |
| 31 #include "chrome/installer/util/l10n_string_util.h" | 31 #include "chrome/installer/util/l10n_string_util.h" |
| 32 #include "chrome/installer/util/uninstall_metrics.h" | 32 #include "chrome/installer/util/uninstall_metrics.h" |
| 33 #include "chrome/installer/util/updating_app_registration_data.h" | 33 #include "chrome/installer/util/updating_app_registration_data.h" |
| 34 #include "chrome/installer/util/wmi.h" | 34 #include "chrome/installer/util/wmi.h" |
| 35 #include "third_party/crashpad/crashpad/client/crash_report_database.h" | 35 #include "third_party/crashpad/crashpad/client/crash_report_database.h" |
| 36 #include "third_party/crashpad/crashpad/client/settings.h" | 36 #include "third_party/crashpad/crashpad/client/settings.h" |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; | |
| 41 | |
| 42 // Substitute the locale parameter in uninstall URL with whatever | 40 // Substitute the locale parameter in uninstall URL with whatever |
| 43 // Google Update tells us is the locale. In case we fail to find | 41 // Google Update tells us is the locale. In case we fail to find |
| 44 // the locale, we use US English. | 42 // the locale, we use US English. |
| 45 base::string16 LocalizeUrl(const wchar_t* url) { | 43 base::string16 LocalizeUrl(const wchar_t* url) { |
| 46 base::string16 language; | 44 base::string16 language; |
| 47 if (!GoogleUpdateSettings::GetLanguage(&language)) | 45 if (!GoogleUpdateSettings::GetLanguage(&language)) |
| 48 language = L"en-US"; // Default to US English. | 46 language = L"en-US"; // Default to US English. |
| 49 return base::ReplaceStringPlaceholders(url, language, NULL); | 47 return base::ReplaceStringPlaceholders(url, language, NULL); |
| 50 } | 48 } |
| 51 | 49 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 82 // The reason we use WMI to launch the process is because the uninstall | 80 // The reason we use WMI to launch the process is because the uninstall |
| 83 // process runs inside a Job object controlled by the shell. As long as there | 81 // process runs inside a Job object controlled by the shell. As long as there |
| 84 // are processes running, the shell will not close the uninstall applet. WMI | 82 // are processes running, the shell will not close the uninstall applet. WMI |
| 85 // allows us to escape from the Job object so the applet will close. | 83 // allows us to escape from the Job object so the applet will close. |
| 86 installer::WMIProcess::Launch(command, &pid); | 84 installer::WMIProcess::Launch(command, &pid); |
| 87 } | 85 } |
| 88 | 86 |
| 89 } // namespace | 87 } // namespace |
| 90 | 88 |
| 91 GoogleChromeDistribution::GoogleChromeDistribution() | 89 GoogleChromeDistribution::GoogleChromeDistribution() |
| 92 : BrowserDistribution( | 90 : BrowserDistribution(base::MakeUnique<UpdatingAppRegistrationData>( |
| 93 base::MakeUnique<UpdatingAppRegistrationData>(kChromeGuid)) {} | 91 install_static::GetAppGuid())) {} |
| 94 | |
| 95 GoogleChromeDistribution::GoogleChromeDistribution( | |
| 96 std::unique_ptr<AppRegistrationData> app_reg_data) | |
| 97 : BrowserDistribution(std::move(app_reg_data)) {} | |
| 98 | 92 |
| 99 void GoogleChromeDistribution::DoPostUninstallOperations( | 93 void GoogleChromeDistribution::DoPostUninstallOperations( |
| 100 const base::Version& version, | 94 const base::Version& version, |
| 101 const base::FilePath& local_data_path, | 95 const base::FilePath& local_data_path, |
| 102 const base::string16& distribution_data) { | 96 const base::string16& distribution_data) { |
| 103 // Send the Chrome version and OS version as params to the form. | 97 // Send the Chrome version and OS version as params to the form. |
| 104 // It would be nice to send the locale, too, but I don't see an | 98 // It would be nice to send the locale, too, but I don't see an |
| 105 // easy way to get that in the existing code. It's something we | 99 // easy way to get that in the existing code. It's something we |
| 106 // can add later, if needed. | 100 // can add later, if needed. |
| 107 // We depend on installed_version.GetString() not having spaces or other | 101 // We depend on installed_version.GetString() not having spaces or other |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // string (if it is present) regardless of whether installer failed or not. | 214 // string (if it is present) regardless of whether installer failed or not. |
| 221 // There is no fall-back for full installer :) | 215 // There is no fall-back for full installer :) |
| 222 void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, | 216 void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, |
| 223 installer::ArchiveType archive_type, | 217 installer::ArchiveType archive_type, |
| 224 installer::InstallStatus install_status) { | 218 installer::InstallStatus install_status) { |
| 225 GoogleUpdateSettings::UpdateInstallStatus( | 219 GoogleUpdateSettings::UpdateInstallStatus( |
| 226 system_install, archive_type, | 220 system_install, archive_type, |
| 227 InstallUtil::GetInstallReturnCode(install_status), | 221 InstallUtil::GetInstallReturnCode(install_status), |
| 228 install_static::GetAppGuid()); | 222 install_static::GetAppGuid()); |
| 229 } | 223 } |
| OLD | NEW |