OLD | NEW |
(Empty) | |
| 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 |
| 23 namespace { |
| 24 const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; |
| 25 } |
| 26 |
| 27 ChromeAppHostDistribution::ChromeAppHostDistribution() |
| 28 : BrowserDistribution(CHROME_APP_HOST) { |
| 29 } |
| 30 |
| 31 string16 ChromeAppHostDistribution::GetAppGuid() { |
| 32 return kChromeAppHostGuid; |
| 33 } |
| 34 |
| 35 string16 ChromeAppHostDistribution::GetBaseAppName() { |
| 36 return L"Google Chrome App Host"; |
| 37 } |
| 38 |
| 39 string16 ChromeAppHostDistribution::GetAppShortCutName() { |
| 40 const string16& product_name = |
| 41 installer::GetLocalizedString(IDS_PRODUCT_APP_HOST_NAME_BASE); |
| 42 return product_name; |
| 43 } |
| 44 |
| 45 string16 ChromeAppHostDistribution::GetAlternateApplicationName() { |
| 46 const string16& product_name = |
| 47 installer::GetLocalizedString(IDS_PRODUCT_APP_HOST_NAME_BASE); |
| 48 return product_name; |
| 49 } |
| 50 |
| 51 string16 ChromeAppHostDistribution::GetInstallSubDir() { |
| 52 return BrowserDistribution::GetSpecificDistribution( |
| 53 BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir(); |
| 54 } |
| 55 |
| 56 string16 ChromeAppHostDistribution::GetPublisherName() { |
| 57 const string16& publisher_name = |
| 58 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); |
| 59 return publisher_name; |
| 60 } |
| 61 |
| 62 string16 ChromeAppHostDistribution::GetAppDescription() { |
| 63 NOTREACHED() << "This should never be accessed due to no start-menu/task-bar " |
| 64 << "shortcuts."; |
| 65 return L"A standalone platform for Chrome apps."; |
| 66 } |
| 67 |
| 68 string16 ChromeAppHostDistribution::GetLongAppDescription() { |
| 69 NOTREACHED() << "This should never be accessed as Chrome App Host is not a " |
| 70 << "default browser option."; |
| 71 return L"A standalone platform for Chrome apps."; |
| 72 } |
| 73 |
| 74 std::string ChromeAppHostDistribution::GetSafeBrowsingName() { |
| 75 return "googlechromeapphost"; |
| 76 } |
| 77 |
| 78 string16 ChromeAppHostDistribution::GetStateKey() { |
| 79 string16 key(google_update::kRegPathClientState); |
| 80 key.append(L"\\"); |
| 81 key.append(kChromeAppHostGuid); |
| 82 return key; |
| 83 } |
| 84 |
| 85 string16 ChromeAppHostDistribution::GetStateMediumKey() { |
| 86 string16 key(google_update::kRegPathClientStateMedium); |
| 87 key.append(L"\\"); |
| 88 key.append(kChromeAppHostGuid); |
| 89 return key; |
| 90 } |
| 91 |
| 92 string16 ChromeAppHostDistribution::GetStatsServerURL() { |
| 93 return L"https://clients4.google.com/firefox/metrics/collect"; |
| 94 } |
| 95 |
| 96 std::string ChromeAppHostDistribution::GetNetworkStatsServer() const { |
| 97 return chrome_common_net::kEchoTestServerLocation; |
| 98 } |
| 99 |
| 100 std::string ChromeAppHostDistribution::GetHttpPipeliningTestServer() const { |
| 101 return chrome_common_net::kPipelineTestServerBaseUrl; |
| 102 } |
| 103 |
| 104 string16 ChromeAppHostDistribution::GetUninstallLinkName() { |
| 105 NOTREACHED() << "This should never be accessed as Chrome App Host has no " |
| 106 << "uninstall entry."; |
| 107 return L"Uninstall Chrome App Host"; |
| 108 } |
| 109 |
| 110 string16 ChromeAppHostDistribution::GetUninstallRegPath() { |
| 111 NOTREACHED() << "This should never be accessed as Chrome App Host has no " |
| 112 << "uninstall entry."; |
| 113 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" |
| 114 L"Google Chrome App Host"; |
| 115 } |
| 116 |
| 117 string16 ChromeAppHostDistribution::GetVersionKey() { |
| 118 string16 key(google_update::kRegPathClients); |
| 119 key.append(L"\\"); |
| 120 key.append(kChromeAppHostGuid); |
| 121 return key; |
| 122 } |
| 123 |
| 124 bool ChromeAppHostDistribution::CanSetAsDefault() { |
| 125 return false; |
| 126 } |
| 127 |
| 128 bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() { |
| 129 return false; |
| 130 } |
| 131 |
| 132 bool ChromeAppHostDistribution::GetDelegateExecuteHandlerData( |
| 133 string16* handler_class_uuid, |
| 134 string16* type_lib_uuid, |
| 135 string16* type_lib_version, |
| 136 string16* interface_uuid) { |
| 137 return false; |
| 138 } |
| 139 |
| 140 void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install, |
| 141 installer::ArchiveType archive_type, |
| 142 installer::InstallStatus install_status) { |
| 143 #if defined(GOOGLE_CHROME_BUILD) |
| 144 GoogleUpdateSettings::UpdateInstallStatus(system_install, |
| 145 archive_type, InstallUtil::GetInstallReturnCode(install_status), |
| 146 kChromeAppHostGuid); |
| 147 #endif |
| 148 } |
OLD | NEW |