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
3 // found in the LICENSE file.
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
7 // Chrome App Host installer that does not interact with Google Chrome or
8 // Chromium installations.
10 #include "chrome/installer/util/chrome_app_host_distribution.h"
12 #include "base/strings/string_util.h"
13 #include "chrome/common/net/test_server_locations.h"
14 #include "chrome/installer/util/channel_info.h"
15 #include "chrome/installer/util/google_update_constants.h"
16 #include "chrome/installer/util/google_update_settings.h"
17 #include "chrome/installer/util/helper.h"
18 #include "chrome/installer/util/install_util.h"
19 #include "chrome/installer/util/l10n_string_util.h"
21 #include "installer_util_strings.h" // NOLINT
25 const wchar_t kChromeAppHostGuid
[] = L
"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
29 ChromeAppHostDistribution::ChromeAppHostDistribution()
30 : BrowserDistribution(CHROME_APP_HOST
) {
33 base::string16
ChromeAppHostDistribution::GetAppGuid() {
34 return kChromeAppHostGuid
;
37 base::string16
ChromeAppHostDistribution::GetBaseAppName() {
38 return L
"Google Chrome App Launcher";
41 base::string16
ChromeAppHostDistribution::GetBrowserProgIdPrefix() {
43 return base::string16();
46 base::string16
ChromeAppHostDistribution::GetBrowserProgIdDesc() {
48 return base::string16();
51 base::string16
ChromeAppHostDistribution::GetDisplayName() {
52 return GetShortcutName(SHORTCUT_APP_LAUNCHER
);
55 base::string16
ChromeAppHostDistribution::GetShortcutName(
56 ShortcutType shortcut_type
) {
57 DCHECK_EQ(shortcut_type
, SHORTCUT_APP_LAUNCHER
);
58 return installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE
);
61 base::string16
ChromeAppHostDistribution::GetBaseAppId() {
62 // Should be same as AppListController::GetAppModelId().
63 return L
"ChromeAppList";
66 base::string16
ChromeAppHostDistribution::GetInstallSubDir() {
67 return BrowserDistribution::GetSpecificDistribution(
68 BrowserDistribution::CHROME_BINARIES
)->GetInstallSubDir();
71 base::string16
ChromeAppHostDistribution::GetPublisherName() {
72 const base::string16
& publisher_name
=
73 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE
);
74 return publisher_name
;
77 base::string16
ChromeAppHostDistribution::GetAppDescription() {
78 const base::string16
& app_description
=
79 installer::GetLocalizedString(IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP_BASE
);
80 return app_description
;
83 base::string16
ChromeAppHostDistribution::GetLongAppDescription() {
84 const base::string16
& app_description
=
85 installer::GetLocalizedString(IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION_BASE
);
86 return app_description
;
89 std::string
ChromeAppHostDistribution::GetSafeBrowsingName() {
90 return "googlechromeapphost";
93 base::string16
ChromeAppHostDistribution::GetStateKey() {
94 base::string16
key(google_update::kRegPathClientState
);
96 key
.append(kChromeAppHostGuid
);
100 base::string16
ChromeAppHostDistribution::GetStateMediumKey() {
101 base::string16
key(google_update::kRegPathClientStateMedium
);
103 key
.append(kChromeAppHostGuid
);
107 std::string
ChromeAppHostDistribution::GetNetworkStatsServer() const {
108 return chrome_common_net::kEchoTestServerLocation
;
111 std::string
ChromeAppHostDistribution::GetHttpPipeliningTestServer() const {
112 return chrome_common_net::kPipelineTestServerBaseUrl
;
115 base::string16
ChromeAppHostDistribution::GetUninstallLinkName() {
116 const base::string16
& link_name
=
117 installer::GetLocalizedString(IDS_UNINSTALL_APP_LAUNCHER_BASE
);
121 base::string16
ChromeAppHostDistribution::GetUninstallRegPath() {
122 return L
"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
123 L
"Google Chrome App Launcher";
126 base::string16
ChromeAppHostDistribution::GetVersionKey() {
127 base::string16
key(google_update::kRegPathClients
);
129 key
.append(kChromeAppHostGuid
);
133 BrowserDistribution::DefaultBrowserControlPolicy
134 ChromeAppHostDistribution::GetDefaultBrowserControlPolicy() {
135 return DEFAULT_BROWSER_UNSUPPORTED
;
138 bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() {
142 base::string16
ChromeAppHostDistribution::GetIconFilename() {
143 return installer::kChromeAppHostExe
;
146 bool ChromeAppHostDistribution::GetCommandExecuteImplClsid(
147 base::string16
* handler_class_uuid
) {
151 void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install
,
152 installer::ArchiveType archive_type
,
153 installer::InstallStatus install_status
) {
154 #if defined(GOOGLE_CHROME_BUILD)
155 GoogleUpdateSettings::UpdateInstallStatus(system_install
,
156 archive_type
, InstallUtil::GetInstallReturnCode(install_status
),