Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / installer / util / chrome_frame_distribution.cc
blobf141c83724052b118299035a2cd57856b6ece47c
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 Frame. It overrides the bare minimum of methods necessary to get a
7 // Chrome Frame installer that does not interact with Google Chrome or
8 // Chromium installations.
10 #include "chrome/installer/util/chrome_frame_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 {
24 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}";
27 ChromeFrameDistribution::ChromeFrameDistribution()
28 : BrowserDistribution(CHROME_FRAME) {
31 base::string16 ChromeFrameDistribution::GetAppGuid() {
32 return kChromeFrameGuid;
35 base::string16 ChromeFrameDistribution::GetBaseAppName() {
36 return L"Google Chrome Frame";
39 base::string16 ChromeFrameDistribution::GetBrowserProgIdPrefix() {
40 NOTREACHED();
41 return base::string16();
44 base::string16 ChromeFrameDistribution::GetBrowserProgIdDesc() {
45 NOTREACHED();
46 return base::string16();
49 base::string16 ChromeFrameDistribution::GetDisplayName() {
50 #if defined(GOOGLE_CHROME_BUILD)
51 return L"Google Chrome Frame";
52 #else
53 return L"Chromium Frame";
54 #endif
57 base::string16 ChromeFrameDistribution::GetShortcutName(
58 ShortcutType shortcut_type) {
59 NOTREACHED();
60 return base::string16();
63 base::string16 ChromeFrameDistribution::GetInstallSubDir() {
64 return L"Google\\Chrome Frame";
67 base::string16 ChromeFrameDistribution::GetPublisherName() {
68 const base::string16& publisher_name =
69 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE);
70 return publisher_name;
73 base::string16 ChromeFrameDistribution::GetAppDescription() {
74 return L"Chrome in a Frame.";
77 base::string16 ChromeFrameDistribution::GetLongAppDescription() {
78 return L"Chrome in a Frame.";
81 std::string ChromeFrameDistribution::GetSafeBrowsingName() {
82 return "googlechromeframe";
85 base::string16 ChromeFrameDistribution::GetStateKey() {
86 base::string16 key(google_update::kRegPathClientState);
87 key.append(L"\\");
88 key.append(kChromeFrameGuid);
89 return key;
92 base::string16 ChromeFrameDistribution::GetStateMediumKey() {
93 base::string16 key(google_update::kRegPathClientStateMedium);
94 key.append(L"\\");
95 key.append(kChromeFrameGuid);
96 return key;
99 std::string ChromeFrameDistribution::GetNetworkStatsServer() const {
100 return chrome_common_net::kEchoTestServerLocation;
103 std::string ChromeFrameDistribution::GetHttpPipeliningTestServer() const {
104 return chrome_common_net::kPipelineTestServerBaseUrl;
107 base::string16 ChromeFrameDistribution::GetUninstallLinkName() {
108 return L"Uninstall Chrome Frame";
111 base::string16 ChromeFrameDistribution::GetUninstallRegPath() {
112 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
113 L"Google Chrome Frame";
116 base::string16 ChromeFrameDistribution::GetVersionKey() {
117 base::string16 key(google_update::kRegPathClients);
118 key.append(L"\\");
119 key.append(kChromeFrameGuid);
120 return key;
123 base::string16 ChromeFrameDistribution::GetIconFilename() {
124 return installer::kChromeExe;
127 int ChromeFrameDistribution::GetIconIndex(ShortcutType shortcut_type) {
128 switch (shortcut_type) {
129 case SHORTCUT_CHROME:
130 return 0;
131 default:
132 NOTREACHED();
133 return 0;
137 BrowserDistribution::DefaultBrowserControlPolicy
138 ChromeFrameDistribution::GetDefaultBrowserControlPolicy() {
139 return DEFAULT_BROWSER_UNSUPPORTED;
142 bool ChromeFrameDistribution::CanCreateDesktopShortcuts() {
143 return false;
146 bool ChromeFrameDistribution::GetCommandExecuteImplClsid(
147 base::string16* handler_class_uuid) {
148 return false;
151 void ChromeFrameDistribution::UpdateInstallStatus(bool system_install,
152 installer::ArchiveType archive_type,
153 installer::InstallStatus install_status) {
154 #if defined(GOOGLE_CHROME_BUILD)
155 GoogleUpdateSettings::UpdateInstallStatus(system_install,
156 archive_type, InstallUtil::GetInstallReturnCode(install_status),
157 kChromeFrameGuid);
158 #endif