OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #if defined(GOOGLE_CHROME_BUILD) | 5 #if defined(GOOGLE_CHROME_BUILD) |
6 | 6 |
7 #include "chrome/installer/setup/app_launcher_installer.h" | 7 #include "chrome/installer/setup/app_launcher_installer.h" |
8 | 8 |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
| 11 #include "chrome/installer/setup/brand_constants.h" |
11 #include "chrome/installer/setup/install_worker.h" | 12 #include "chrome/installer/setup/install_worker.h" |
12 #include "chrome/installer/setup/setup_util.h" | 13 #include "chrome/installer/setup/setup_util.h" |
13 #include "chrome/installer/util/google_update_constants.h" | 14 #include "chrome/installer/util/google_update_constants.h" |
14 #include "chrome/installer/util/install_util.h" | 15 #include "chrome/installer/util/install_util.h" |
15 #include "chrome/installer/util/installer_state.h" | 16 #include "chrome/installer/util/installer_state.h" |
16 #include "chrome/installer/util/installer_util_strings.h" | 17 #include "chrome/installer/util/installer_util_strings.h" |
17 #include "chrome/installer/util/l10n_string_util.h" | 18 #include "chrome/installer/util/l10n_string_util.h" |
18 #include "chrome/installer/util/product.h" | 19 #include "chrome/installer/util/product.h" |
19 #include "chrome/installer/util/updating_app_registration_data.h" | 20 #include "chrome/installer/util/updating_app_registration_data.h" |
20 #include "chrome/installer/util/work_item.h" | 21 #include "chrome/installer/util/work_item.h" |
(...skipping 23 matching lines...) Expand all Loading... |
44 auto* delete_reg_key_work_item = list->AddDeleteRegKeyWorkItem( | 45 auto* delete_reg_key_work_item = list->AddDeleteRegKeyWorkItem( |
45 installer_state.root_key(), GetRegistrationDataCommandKey(reg_data, name), | 46 installer_state.root_key(), GetRegistrationDataCommandKey(reg_data, name), |
46 KEY_WOW64_32KEY); | 47 KEY_WOW64_32KEY); |
47 delete_reg_key_work_item->set_best_effort(true); | 48 delete_reg_key_work_item->set_best_effort(true); |
48 delete_reg_key_work_item->set_rollback_enabled(false); | 49 delete_reg_key_work_item->set_rollback_enabled(false); |
49 } | 50 } |
50 | 51 |
51 } // namespace | 52 } // namespace |
52 | 53 |
53 void RemoveAppLauncherVersionKey(HKEY reg_root) { | 54 void RemoveAppLauncherVersionKey(HKEY reg_root) { |
54 DCHECK(!InstallUtil::IsChromeSxSProcess()); | 55 DCHECK(GetBrandConstants().supported_app_launcher); |
55 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid); | 56 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid); |
56 InstallUtil::DeleteRegistryKey( | 57 InstallUtil::DeleteRegistryKey( |
57 reg_root, app_launcher_reg_data.GetVersionKey(), KEY_WOW64_32KEY); | 58 reg_root, app_launcher_reg_data.GetVersionKey(), KEY_WOW64_32KEY); |
58 } | 59 } |
59 | 60 |
60 void AddRemoveLegacyAppHostExeWorkItems(const base::FilePath& target_path, | 61 void AddRemoveLegacyAppHostExeWorkItems(const base::FilePath& target_path, |
61 const base::FilePath& temp_path, | 62 const base::FilePath& temp_path, |
62 WorkItemList* list) { | 63 WorkItemList* list) { |
63 DCHECK(!InstallUtil::IsChromeSxSProcess()); | 64 DCHECK(GetBrandConstants().supported_app_launcher); |
64 auto* delete_tree_work_item = list->AddDeleteTreeWorkItem( | 65 auto* delete_tree_work_item = list->AddDeleteTreeWorkItem( |
65 target_path.Append(kLegacyChromeAppHostExe), temp_path); | 66 target_path.Append(kLegacyChromeAppHostExe), temp_path); |
66 delete_tree_work_item->set_best_effort(true); | 67 delete_tree_work_item->set_best_effort(true); |
67 delete_tree_work_item->set_rollback_enabled(false); | 68 delete_tree_work_item->set_rollback_enabled(false); |
68 } | 69 } |
69 | 70 |
70 void AddRemoveLegacyAppCommandsWorkItems(const InstallerState& installer_state, | 71 void AddRemoveLegacyAppCommandsWorkItems(const InstallerState& installer_state, |
71 WorkItemList* list) { | 72 WorkItemList* list) { |
72 DCHECK(!InstallUtil::IsChromeSxSProcess()); | 73 DCHECK(GetBrandConstants().supported_app_launcher); |
73 DCHECK(list); | 74 DCHECK(list); |
74 for (const auto* p : installer_state.products()) { | 75 for (const auto* p : installer_state.products()) { |
75 if (p->is_chrome()) { | 76 if (p->is_chrome()) { |
76 // Remove "install-application" command from App Launcher. | 77 // Remove "install-application" command from App Launcher. |
77 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid); | 78 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid); |
78 AddLegacyAppCommandRemovalItem(installer_state, app_launcher_reg_data, | 79 AddLegacyAppCommandRemovalItem(installer_state, app_launcher_reg_data, |
79 kLegacyCmdInstallApp, list); | 80 kLegacyCmdInstallApp, list); |
80 | 81 |
81 // Remove "install-extension" command from Chrome. | 82 // Remove "install-extension" command from Chrome. |
82 const AppRegistrationData& chrome_reg_data = | 83 const AppRegistrationData& chrome_reg_data = |
(...skipping 10 matching lines...) Expand all Loading... |
93 // Remove "quick-enable-application-host" command from Binaries. | 94 // Remove "quick-enable-application-host" command from Binaries. |
94 AddLegacyAppCommandRemovalItem(installer_state, binaries_reg_data, | 95 AddLegacyAppCommandRemovalItem(installer_state, binaries_reg_data, |
95 kLegacyCmdQuickEnableApplicationHost, list); | 96 kLegacyCmdQuickEnableApplicationHost, list); |
96 } | 97 } |
97 } | 98 } |
98 } | 99 } |
99 | 100 |
100 } // namespace installer | 101 } // namespace installer |
101 | 102 |
102 #endif // GOOGLE_CHROME_BUILD | 103 #endif // GOOGLE_CHROME_BUILD |
OLD | NEW |