chrome_app_host_distribution.cc revision b2df76ea8fec9e32f6f3718986dba0d95315b29c
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. 4// 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. 9 10#include "chrome/installer/util/chrome_app_host_distribution.h" 11 12#include "base/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" 20 21#include "installer_util_strings.h" // NOLINT 22 23namespace { 24 25const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; 26 27} // namespace 28 29ChromeAppHostDistribution::ChromeAppHostDistribution() 30 : BrowserDistribution(CHROME_APP_HOST) { 31} 32 33string16 ChromeAppHostDistribution::GetAppGuid() { 34 return kChromeAppHostGuid; 35} 36 37string16 ChromeAppHostDistribution::GetBaseAppName() { 38 return L"Google Chrome App Launcher"; 39} 40 41string16 ChromeAppHostDistribution::GetAppShortCutName() { 42 const string16& product_name = 43 installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE); 44 return product_name; 45} 46 47string16 ChromeAppHostDistribution::GetAlternateApplicationName() { 48 const string16& product_name = 49 installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE); 50 return product_name; 51} 52 53string16 ChromeAppHostDistribution::GetBaseAppId() { 54 // Should be same as AppListController::GetAppModelId(). 55 return L"ChromeAppList"; 56} 57 58string16 ChromeAppHostDistribution::GetInstallSubDir() { 59 return BrowserDistribution::GetSpecificDistribution( 60 BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir(); 61} 62 63string16 ChromeAppHostDistribution::GetPublisherName() { 64 const string16& publisher_name = 65 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); 66 return publisher_name; 67} 68 69string16 ChromeAppHostDistribution::GetAppDescription() { 70 const string16& app_description = 71 installer::GetLocalizedString(IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP_BASE); 72 return app_description; 73} 74 75string16 ChromeAppHostDistribution::GetLongAppDescription() { 76 const string16& app_description = 77 installer::GetLocalizedString(IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION_BASE); 78 return app_description; 79} 80 81std::string ChromeAppHostDistribution::GetSafeBrowsingName() { 82 return "googlechromeapphost"; 83} 84 85string16 ChromeAppHostDistribution::GetStateKey() { 86 string16 key(google_update::kRegPathClientState); 87 key.append(L"\\"); 88 key.append(kChromeAppHostGuid); 89 return key; 90} 91 92string16 ChromeAppHostDistribution::GetStateMediumKey() { 93 string16 key(google_update::kRegPathClientStateMedium); 94 key.append(L"\\"); 95 key.append(kChromeAppHostGuid); 96 return key; 97} 98 99std::string ChromeAppHostDistribution::GetNetworkStatsServer() const { 100 return chrome_common_net::kEchoTestServerLocation; 101} 102 103std::string ChromeAppHostDistribution::GetHttpPipeliningTestServer() const { 104 return chrome_common_net::kPipelineTestServerBaseUrl; 105} 106 107string16 ChromeAppHostDistribution::GetUninstallLinkName() { 108 const string16& link_name = 109 installer::GetLocalizedString(IDS_UNINSTALL_APP_LAUNCHER_BASE); 110 return link_name; 111} 112 113string16 ChromeAppHostDistribution::GetUninstallRegPath() { 114 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" 115 L"Google Chrome App Launcher"; 116} 117 118string16 ChromeAppHostDistribution::GetVersionKey() { 119 string16 key(google_update::kRegPathClients); 120 key.append(L"\\"); 121 key.append(kChromeAppHostGuid); 122 return key; 123} 124 125bool ChromeAppHostDistribution::CanSetAsDefault() { 126 return false; 127} 128 129bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() { 130 return true; 131} 132 133string16 ChromeAppHostDistribution::GetIconFilename() { 134 return installer::kChromeAppHostExe; 135} 136 137bool ChromeAppHostDistribution::GetCommandExecuteImplClsid( 138 string16* handler_class_uuid) { 139 return false; 140} 141 142void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install, 143 installer::ArchiveType archive_type, 144 installer::InstallStatus install_status) { 145#if defined(GOOGLE_CHROME_BUILD) 146 GoogleUpdateSettings::UpdateInstallStatus(system_install, 147 archive_type, InstallUtil::GetInstallReturnCode(install_status), 148 kChromeAppHostGuid); 149#endif 150} 151