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