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. 9 10 #include "chrome/installer/util/chrome_frame_distribution.h" 11 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" 20 21 #include "installer_util_strings.h" // NOLINT 22 23 namespace { 24 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; 25 } 26 ChromeFrameDistribution()27ChromeFrameDistribution::ChromeFrameDistribution() 28 : BrowserDistribution(CHROME_FRAME) { 29 } 30 GetAppGuid()31string16 ChromeFrameDistribution::GetAppGuid() { 32 return kChromeFrameGuid; 33 } 34 GetBaseAppName()35string16 ChromeFrameDistribution::GetBaseAppName() { 36 return L"Google Chrome Frame"; 37 } 38 GetBrowserProgIdPrefix()39string16 ChromeFrameDistribution::GetBrowserProgIdPrefix() { 40 NOTREACHED(); 41 return string16(); 42 } 43 GetBrowserProgIdDesc()44string16 ChromeFrameDistribution::GetBrowserProgIdDesc() { 45 NOTREACHED(); 46 return string16(); 47 } 48 GetShortcutName(ShortcutType shortcut_type)49string16 ChromeFrameDistribution::GetShortcutName(ShortcutType shortcut_type) { 50 switch (shortcut_type) { 51 case SHORTCUT_CHROME: 52 case SHORTCUT_CHROME_ALTERNATE: 53 return installer::GetLocalizedString(IDS_PRODUCT_FRAME_NAME_BASE); 54 default: 55 NOTREACHED(); 56 return string16(); 57 } 58 } 59 GetInstallSubDir()60string16 ChromeFrameDistribution::GetInstallSubDir() { 61 return L"Google\\Chrome Frame"; 62 } 63 GetPublisherName()64string16 ChromeFrameDistribution::GetPublisherName() { 65 const string16& publisher_name = 66 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); 67 return publisher_name; 68 } 69 GetAppDescription()70string16 ChromeFrameDistribution::GetAppDescription() { 71 return L"Chrome in a Frame."; 72 } 73 GetLongAppDescription()74string16 ChromeFrameDistribution::GetLongAppDescription() { 75 return L"Chrome in a Frame."; 76 } 77 GetSafeBrowsingName()78std::string ChromeFrameDistribution::GetSafeBrowsingName() { 79 return "googlechromeframe"; 80 } 81 GetStateKey()82string16 ChromeFrameDistribution::GetStateKey() { 83 string16 key(google_update::kRegPathClientState); 84 key.append(L"\\"); 85 key.append(kChromeFrameGuid); 86 return key; 87 } 88 GetStateMediumKey()89string16 ChromeFrameDistribution::GetStateMediumKey() { 90 string16 key(google_update::kRegPathClientStateMedium); 91 key.append(L"\\"); 92 key.append(kChromeFrameGuid); 93 return key; 94 } 95 GetNetworkStatsServer() const96std::string ChromeFrameDistribution::GetNetworkStatsServer() const { 97 return chrome_common_net::kEchoTestServerLocation; 98 } 99 GetHttpPipeliningTestServer() const100std::string ChromeFrameDistribution::GetHttpPipeliningTestServer() const { 101 return chrome_common_net::kPipelineTestServerBaseUrl; 102 } 103 GetUninstallLinkName()104string16 ChromeFrameDistribution::GetUninstallLinkName() { 105 return L"Uninstall Chrome Frame"; 106 } 107 GetUninstallRegPath()108string16 ChromeFrameDistribution::GetUninstallRegPath() { 109 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" 110 L"Google Chrome Frame"; 111 } 112 GetVersionKey()113string16 ChromeFrameDistribution::GetVersionKey() { 114 string16 key(google_update::kRegPathClients); 115 key.append(L"\\"); 116 key.append(kChromeFrameGuid); 117 return key; 118 } 119 GetIconFilename()120string16 ChromeFrameDistribution::GetIconFilename() { 121 return installer::kChromeExe; 122 } 123 GetIconIndex(ShortcutType shortcut_type)124int ChromeFrameDistribution::GetIconIndex(ShortcutType shortcut_type) { 125 switch (shortcut_type) { 126 case SHORTCUT_CHROME: 127 return 0; 128 default: 129 NOTREACHED(); 130 return 0; 131 } 132 } 133 134 BrowserDistribution::DefaultBrowserControlPolicy GetDefaultBrowserControlPolicy()135 ChromeFrameDistribution::GetDefaultBrowserControlPolicy() { 136 return DEFAULT_BROWSER_UNSUPPORTED; 137 } 138 CanCreateDesktopShortcuts()139bool ChromeFrameDistribution::CanCreateDesktopShortcuts() { 140 return false; 141 } 142 GetCommandExecuteImplClsid(string16 * handler_class_uuid)143bool ChromeFrameDistribution::GetCommandExecuteImplClsid( 144 string16* handler_class_uuid) { 145 return false; 146 } 147 UpdateInstallStatus(bool system_install,installer::ArchiveType archive_type,installer::InstallStatus install_status)148void ChromeFrameDistribution::UpdateInstallStatus(bool system_install, 149 installer::ArchiveType archive_type, 150 installer::InstallStatus install_status) { 151 #if defined(GOOGLE_CHROME_BUILD) 152 GoogleUpdateSettings::UpdateInstallStatus(system_install, 153 archive_type, InstallUtil::GetInstallReturnCode(install_status), 154 kChromeFrameGuid); 155 #endif 156 } 157