Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: chrome/installer/util/chrome_app_host_distribution.cc

Issue 14031025: Implementing unified Chrome / App Launcher flow, and migrating old stand-alone App Launcher. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feature-complete (except for unit tests for ShellUtil shortcut update code). Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 a specific implementation of BrowserDistribution class for 5 // This file defines a specific implementation of BrowserDistribution class for
6 // Chrome App Host. It overrides the bare minimum of methods necessary to get a 6 // Chrome App Host. It overrides the bare minimum of methods necessary to get a
7 // Chrome App Host installer that does not interact with Google Chrome or 7 // Chrome App Host installer that does not interact with Google Chrome or
8 // Chromium installations. 8 // Chromium installations.
9 9
10 #include "chrome/installer/util/chrome_app_host_distribution.h" 10 #include "chrome/installer/util/chrome_app_host_distribution.h"
11 11
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "chrome/common/net/test_server_locations.h" 13 #include "chrome/common/net/test_server_locations.h"
14 #include "chrome/installer/util/channel_info.h" 14 #include "chrome/installer/util/channel_info.h"
15 #include "chrome/installer/util/google_update_constants.h" 15 #include "chrome/installer/util/google_update_constants.h"
16 #include "chrome/installer/util/google_update_settings.h" 16 #include "chrome/installer/util/google_update_settings.h"
17 #include "chrome/installer/util/helper.h" 17 #include "chrome/installer/util/helper.h"
18 #include "chrome/installer/util/install_util.h" 18 #include "chrome/installer/util/install_util.h"
19 #include "chrome/installer/util/l10n_string_util.h" 19 #include "chrome/installer/util/l10n_string_util.h"
20 20
21 #include "installer_util_strings.h" // NOLINT 21 #include "installer_util_strings.h" // NOLINT
22 22
23 namespace { 23 namespace {
24 24
25 const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; 25 const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
26 26
27 #if defined(GOOGLE_CHROME_BUILD)
28 const int kAppLauncherIconIndex = 5;
gab 2013/05/15 22:42:20 Coordinate with https://codereview.chromium.org/13
huangs 2013/05/17 20:59:24 Will do so once I merge. Keeping this now for tes
29 #else
30 const int kAppLauncherIconIndex = 1;
31 #endif
32
27 } // namespace 33 } // namespace
28 34
29 ChromeAppHostDistribution::ChromeAppHostDistribution() 35 ChromeAppHostDistribution::ChromeAppHostDistribution()
30 : BrowserDistribution(CHROME_APP_HOST) { 36 : BrowserDistribution(CHROME_APP_HOST) {
31 } 37 }
32 38
33 string16 ChromeAppHostDistribution::GetAppGuid() { 39 string16 ChromeAppHostDistribution::GetAppGuid() {
34 return kChromeAppHostGuid; 40 return kChromeAppHostGuid;
35 } 41 }
36 42
37 string16 ChromeAppHostDistribution::GetBaseAppName() { 43 string16 ChromeAppHostDistribution::GetBaseAppName() {
38 return L"Google Chrome App Launcher"; 44 #if defined(GOOGLE_CHROME_BUILD)
grt (UTC plus 2) 2013/05/16 14:55:52 I think it's safe to replace the body of this func
huangs 2013/05/17 20:59:24 https://codereview.chromium.org/13864015/ will ref
45 return InstallUtil::IsChromeSxSProcess() ?
46 L"Google Chrome Canary App Launcher" : L"Google Chrome App Launcher";
47 #else
48 return L"Chromium App Launcher";
49 #endif
50 }
51
52 string16 ChromeAppHostDistribution::GetAppShortCutFolderName() {
53 #if defined(GOOGLE_CHROME_BUILD)
grt (UTC plus 2) 2013/05/16 14:55:52 Can this whole function become: GetSpecificDistr
huangs 2013/05/17 20:59:24 Discussed with gab@, the plan for (https://coderev
54 return InstallUtil::IsChromeSxSProcess() ?
55 installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE) :
56 installer::GetLocalizedString(IDS_PRODUCT_NAME_BASE);
57 #else
58 return L"Chromium";
59 #endif
39 } 60 }
40 61
41 string16 ChromeAppHostDistribution::GetAppShortCutName() { 62 string16 ChromeAppHostDistribution::GetAppShortCutName() {
42 const string16& product_name = 63 return installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
43 installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
44 return product_name;
45 } 64 }
46 65
47 string16 ChromeAppHostDistribution::GetAlternateApplicationName() { 66 string16 ChromeAppHostDistribution::GetAlternateApplicationName() {
48 const string16& product_name = 67 return installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
49 installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
50 return product_name;
51 } 68 }
52 69
53 string16 ChromeAppHostDistribution::GetBaseAppId() { 70 string16 ChromeAppHostDistribution::GetBaseAppId() {
54 // Should be same as AppListController::GetAppModelId(). 71 // Should be same as AppListController::GetAppModelId().
55 return L"ChromeAppList"; 72 return L"ChromeAppList";
56 } 73 }
57 74
58 string16 ChromeAppHostDistribution::GetInstallSubDir() { 75 string16 ChromeAppHostDistribution::GetInstallSubDir() {
59 return BrowserDistribution::GetSpecificDistribution( 76 return BrowserDistribution::GetSpecificDistribution(
60 BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir(); 77 BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return chrome_common_net::kPipelineTestServerBaseUrl; 121 return chrome_common_net::kPipelineTestServerBaseUrl;
105 } 122 }
106 123
107 string16 ChromeAppHostDistribution::GetUninstallLinkName() { 124 string16 ChromeAppHostDistribution::GetUninstallLinkName() {
108 const string16& link_name = 125 const string16& link_name =
109 installer::GetLocalizedString(IDS_UNINSTALL_APP_LAUNCHER_BASE); 126 installer::GetLocalizedString(IDS_UNINSTALL_APP_LAUNCHER_BASE);
110 return link_name; 127 return link_name;
111 } 128 }
112 129
113 string16 ChromeAppHostDistribution::GetUninstallRegPath() { 130 string16 ChromeAppHostDistribution::GetUninstallRegPath() {
114 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" 131 NOTREACHED();
115 L"Google Chrome App Launcher"; 132 return string16();
116 } 133 }
117 134
118 string16 ChromeAppHostDistribution::GetVersionKey() { 135 string16 ChromeAppHostDistribution::GetVersionKey() {
119 string16 key(google_update::kRegPathClients); 136 string16 key(google_update::kRegPathClients);
120 key.append(L"\\"); 137 key.append(L"\\");
121 key.append(kChromeAppHostGuid); 138 key.append(kChromeAppHostGuid);
122 return key; 139 return key;
123 } 140 }
124 141
125 bool ChromeAppHostDistribution::CanSetAsDefault() { 142 bool ChromeAppHostDistribution::CanSetAsDefault() {
126 return false; 143 return false;
127 } 144 }
128 145
129 bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() { 146 bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() {
130 return true; 147 return true;
131 } 148 }
132 149
133 string16 ChromeAppHostDistribution::GetIconFilename() { 150 string16 ChromeAppHostDistribution::GetIconFilename() {
134 return installer::kChromeAppHostExe; 151 return installer::kChromeExe;
152 }
153
154 int ChromeAppHostDistribution::GetIconIndex() {
155 return kAppLauncherIconIndex;
135 } 156 }
136 157
137 bool ChromeAppHostDistribution::GetCommandExecuteImplClsid( 158 bool ChromeAppHostDistribution::GetCommandExecuteImplClsid(
138 string16* handler_class_uuid) { 159 string16* handler_class_uuid) {
139 return false; 160 return false;
140 } 161 }
141 162
142 void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install, 163 void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install,
143 installer::ArchiveType archive_type, 164 installer::ArchiveType archive_type,
144 installer::InstallStatus install_status) { 165 installer::InstallStatus install_status) {
145 #if defined(GOOGLE_CHROME_BUILD) 166 #if defined(GOOGLE_CHROME_BUILD)
146 GoogleUpdateSettings::UpdateInstallStatus(system_install, 167 GoogleUpdateSettings::UpdateInstallStatus(system_install,
147 archive_type, InstallUtil::GetInstallReturnCode(install_status), 168 archive_type, InstallUtil::GetInstallReturnCode(install_status),
148 kChromeAppHostGuid); 169 kChromeAppHostGuid);
149 #endif 170 #endif
150 } 171 }
172
173 LegacyChromeAppHostDistribution::LegacyChromeAppHostDistribution() {}
174
175 string16 LegacyChromeAppHostDistribution::GetBaseAppName() {
176 return L"Google Chrome App Launcher";
grt (UTC plus 2) 2013/05/16 14:55:52 see comment above
huangs 2013/05/17 20:59:24 Same as above. This will be deleted. If we decided
177 }
178
179 string16 LegacyChromeAppHostDistribution::GetAppShortCutFolderName() {
180 return GetAppShortCutName();
181 }
182
183 string16 LegacyChromeAppHostDistribution::GetAppShortCutName() {
184 return installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
185 }
186
187 string16 LegacyChromeAppHostDistribution::GetAlternateApplicationName() {
188 return GetAppShortCutName();
189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698