[Android] Added UMA for search by image context menu.
[chromium-blink-merge.git] / chrome / installer / util / chrome_app_host_distribution.cc
blob7c40326e1da752aff86b18e5fd9babda2192d5e9
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.
10 #include "chrome/installer/util/chrome_app_host_distribution.h"
12 #include "base/strings/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"
21 #include "installer_util_strings.h" // NOLINT
23 namespace {
25 const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
27 } // namespace
29 ChromeAppHostDistribution::ChromeAppHostDistribution()
30 : BrowserDistribution(CHROME_APP_HOST) {
33 string16 ChromeAppHostDistribution::GetAppGuid() {
34 return kChromeAppHostGuid;
37 string16 ChromeAppHostDistribution::GetBaseAppName() {
38 return L"Google Chrome App Launcher";
41 string16 ChromeAppHostDistribution::GetAppShortCutName() {
42 const string16& product_name =
43 installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
44 return product_name;
47 string16 ChromeAppHostDistribution::GetAlternateApplicationName() {
48 const string16& product_name =
49 installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
50 return product_name;
53 string16 ChromeAppHostDistribution::GetBaseAppId() {
54 // Should be same as AppListController::GetAppModelId().
55 return L"ChromeAppList";
58 string16 ChromeAppHostDistribution::GetInstallSubDir() {
59 return BrowserDistribution::GetSpecificDistribution(
60 BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir();
63 string16 ChromeAppHostDistribution::GetPublisherName() {
64 const string16& publisher_name =
65 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE);
66 return publisher_name;
69 string16 ChromeAppHostDistribution::GetAppDescription() {
70 const string16& app_description =
71 installer::GetLocalizedString(IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP_BASE);
72 return app_description;
75 string16 ChromeAppHostDistribution::GetLongAppDescription() {
76 const string16& app_description =
77 installer::GetLocalizedString(IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION_BASE);
78 return app_description;
81 std::string ChromeAppHostDistribution::GetSafeBrowsingName() {
82 return "googlechromeapphost";
85 string16 ChromeAppHostDistribution::GetStateKey() {
86 string16 key(google_update::kRegPathClientState);
87 key.append(L"\\");
88 key.append(kChromeAppHostGuid);
89 return key;
92 string16 ChromeAppHostDistribution::GetStateMediumKey() {
93 string16 key(google_update::kRegPathClientStateMedium);
94 key.append(L"\\");
95 key.append(kChromeAppHostGuid);
96 return key;
99 std::string ChromeAppHostDistribution::GetNetworkStatsServer() const {
100 return chrome_common_net::kEchoTestServerLocation;
103 std::string ChromeAppHostDistribution::GetHttpPipeliningTestServer() const {
104 return chrome_common_net::kPipelineTestServerBaseUrl;
107 string16 ChromeAppHostDistribution::GetUninstallLinkName() {
108 const string16& link_name =
109 installer::GetLocalizedString(IDS_UNINSTALL_APP_LAUNCHER_BASE);
110 return link_name;
113 string16 ChromeAppHostDistribution::GetUninstallRegPath() {
114 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
115 L"Google Chrome App Launcher";
118 string16 ChromeAppHostDistribution::GetVersionKey() {
119 string16 key(google_update::kRegPathClients);
120 key.append(L"\\");
121 key.append(kChromeAppHostGuid);
122 return key;
125 bool ChromeAppHostDistribution::CanSetAsDefault() {
126 return false;
129 bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() {
130 return true;
133 string16 ChromeAppHostDistribution::GetIconFilename() {
134 return installer::kChromeAppHostExe;
137 bool ChromeAppHostDistribution::GetCommandExecuteImplClsid(
138 string16* handler_class_uuid) {
139 return false;
142 void 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