| OLD | NEW |
| 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 const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; | 25 const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}"; |
| 25 } | 26 |
| 27 } // namespace |
| 26 | 28 |
| 27 ChromeAppHostDistribution::ChromeAppHostDistribution() | 29 ChromeAppHostDistribution::ChromeAppHostDistribution() |
| 28 : BrowserDistribution(CHROME_APP_HOST) { | 30 : BrowserDistribution(CHROME_APP_HOST) { |
| 29 } | 31 } |
| 30 | 32 |
| 31 string16 ChromeAppHostDistribution::GetAppGuid() { | 33 string16 ChromeAppHostDistribution::GetAppGuid() { |
| 32 return kChromeAppHostGuid; | 34 return kChromeAppHostGuid; |
| 33 } | 35 } |
| 34 | 36 |
| 35 string16 ChromeAppHostDistribution::GetBaseAppName() { | 37 string16 ChromeAppHostDistribution::GetBaseAppName() { |
| 36 return L"Google Chrome App Host"; | 38 return L"Google Chrome App Host"; |
| 37 } | 39 } |
| 38 | 40 |
| 39 string16 ChromeAppHostDistribution::GetAppShortCutName() { | 41 string16 ChromeAppHostDistribution::GetAppShortCutName() { |
| 40 const string16& product_name = | 42 const string16& product_name = |
| 41 installer::GetLocalizedString(IDS_PRODUCT_APP_HOST_NAME_BASE); | 43 installer::GetLocalizedString(IDS_PRODUCT_APP_HOST_NAME_BASE); |
| 42 return product_name; | 44 return product_name; |
| 43 } | 45 } |
| 44 | 46 |
| 45 string16 ChromeAppHostDistribution::GetAlternateApplicationName() { | 47 string16 ChromeAppHostDistribution::GetAlternateApplicationName() { |
| 46 const string16& product_name = | 48 const string16& product_name = |
| 47 installer::GetLocalizedString(IDS_PRODUCT_APP_HOST_NAME_BASE); | 49 installer::GetLocalizedString(IDS_PRODUCT_APP_HOST_NAME_BASE); |
| 48 return product_name; | 50 return product_name; |
| 49 } | 51 } |
| 50 | 52 |
| 53 string16 ChromeAppHostDistribution::GetBaseAppId() { |
| 54 // Should be same as AppListController::GetAppModelId(). |
| 55 return L"ChromeAppList"; |
| 56 } |
| 57 |
| 51 string16 ChromeAppHostDistribution::GetInstallSubDir() { | 58 string16 ChromeAppHostDistribution::GetInstallSubDir() { |
| 52 return BrowserDistribution::GetSpecificDistribution( | 59 return BrowserDistribution::GetSpecificDistribution( |
| 53 BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir(); | 60 BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir(); |
| 54 } | 61 } |
| 55 | 62 |
| 56 string16 ChromeAppHostDistribution::GetPublisherName() { | 63 string16 ChromeAppHostDistribution::GetPublisherName() { |
| 57 const string16& publisher_name = | 64 const string16& publisher_name = |
| 58 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); | 65 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); |
| 59 return publisher_name; | 66 return publisher_name; |
| 60 } | 67 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 key.append(L"\\"); | 124 key.append(L"\\"); |
| 118 key.append(kChromeAppHostGuid); | 125 key.append(kChromeAppHostGuid); |
| 119 return key; | 126 return key; |
| 120 } | 127 } |
| 121 | 128 |
| 122 bool ChromeAppHostDistribution::CanSetAsDefault() { | 129 bool ChromeAppHostDistribution::CanSetAsDefault() { |
| 123 return false; | 130 return false; |
| 124 } | 131 } |
| 125 | 132 |
| 126 bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() { | 133 bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() { |
| 127 return false; | 134 return true; |
| 128 } | 135 } |
| 129 | 136 |
| 130 bool ChromeAppHostDistribution::GetCommandExecuteImplClsid( | 137 bool ChromeAppHostDistribution::GetCommandExecuteImplClsid( |
| 131 string16* handler_class_uuid) { | 138 string16* handler_class_uuid) { |
| 132 return false; | 139 return false; |
| 133 } | 140 } |
| 134 | 141 |
| 135 void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install, | 142 void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install, |
| 136 installer::ArchiveType archive_type, | 143 installer::ArchiveType archive_type, |
| 137 installer::InstallStatus install_status) { | 144 installer::InstallStatus install_status) { |
| 138 #if defined(GOOGLE_CHROME_BUILD) | 145 #if defined(GOOGLE_CHROME_BUILD) |
| 139 GoogleUpdateSettings::UpdateInstallStatus(system_install, | 146 GoogleUpdateSettings::UpdateInstallStatus(system_install, |
| 140 archive_type, InstallUtil::GetInstallReturnCode(install_status), | 147 archive_type, InstallUtil::GetInstallReturnCode(install_status), |
| 141 kChromeAppHostGuid); | 148 kChromeAppHostGuid); |
| 142 #endif | 149 #endif |
| 143 } | 150 } |
| OLD | NEW |