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