| 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 Frame. It overrides the bare minimum of methods necessary to get a | 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 | 7 // Chrome Frame installer that does not interact with Google Chrome or |
| 8 // Chromium installations. | 8 // Chromium installations. |
| 9 | 9 |
| 10 #include "chrome/installer/util/chrome_frame_distribution.h" | 10 #include "chrome/installer/util/chrome_frame_distribution.h" |
| 11 | 11 |
| 12 #include <string> | |
| 13 | |
| 14 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 15 #include "chrome/common/net/test_server_locations.h" | 13 #include "chrome/common/net/test_server_locations.h" |
| 16 #include "chrome/installer/util/channel_info.h" | 14 #include "chrome/installer/util/channel_info.h" |
| 17 #include "chrome/installer/util/google_update_constants.h" | 15 #include "chrome/installer/util/google_update_constants.h" |
| 18 #include "chrome/installer/util/google_update_settings.h" | 16 #include "chrome/installer/util/google_update_settings.h" |
| 19 #include "chrome/installer/util/helper.h" | 17 #include "chrome/installer/util/helper.h" |
| 20 #include "chrome/installer/util/install_util.h" | 18 #include "chrome/installer/util/install_util.h" |
| 21 #include "chrome/installer/util/l10n_string_util.h" | 19 #include "chrome/installer/util/l10n_string_util.h" |
| 22 | 20 |
| 23 #include "installer_util_strings.h" // NOLINT | 21 #include "installer_util_strings.h" // NOLINT |
| 24 | 22 |
| 25 namespace { | 23 namespace { |
| 26 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; | 24 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; |
| 27 } | 25 } |
| 28 | 26 |
| 29 ChromeFrameDistribution::ChromeFrameDistribution() | 27 ChromeFrameDistribution::ChromeFrameDistribution() |
| 30 : BrowserDistribution(CHROME_FRAME) { | 28 : BrowserDistribution(CHROME_FRAME) { |
| 31 } | 29 } |
| 32 | 30 |
| 33 std::wstring ChromeFrameDistribution::GetAppGuid() { | 31 string16 ChromeFrameDistribution::GetAppGuid() { |
| 34 return kChromeFrameGuid; | 32 return kChromeFrameGuid; |
| 35 } | 33 } |
| 36 | 34 |
| 37 std::wstring ChromeFrameDistribution::GetApplicationName() { | 35 string16 ChromeFrameDistribution::GetApplicationName() { |
| 38 return L"Google Chrome Frame"; | 36 return L"Google Chrome Frame"; |
| 39 } | 37 } |
| 40 | 38 |
| 41 std::wstring ChromeFrameDistribution::GetAppShortCutName() { | 39 string16 ChromeFrameDistribution::GetAppShortCutName() { |
| 42 const std::wstring& product_name = | 40 const string16& product_name = |
| 43 installer::GetLocalizedString(IDS_PRODUCT_FRAME_NAME_BASE); | 41 installer::GetLocalizedString(IDS_PRODUCT_FRAME_NAME_BASE); |
| 44 return product_name; | 42 return product_name; |
| 45 } | 43 } |
| 46 | 44 |
| 47 std::wstring ChromeFrameDistribution::GetAlternateApplicationName() { | 45 string16 ChromeFrameDistribution::GetAlternateApplicationName() { |
| 48 const std::wstring& product_name = | 46 const string16& product_name = |
| 49 installer::GetLocalizedString(IDS_PRODUCT_FRAME_NAME_BASE); | 47 installer::GetLocalizedString(IDS_PRODUCT_FRAME_NAME_BASE); |
| 50 return product_name; | 48 return product_name; |
| 51 } | 49 } |
| 52 | 50 |
| 53 std::wstring ChromeFrameDistribution::GetInstallSubDir() { | 51 string16 ChromeFrameDistribution::GetInstallSubDir() { |
| 54 return L"Google\\Chrome Frame"; | 52 return L"Google\\Chrome Frame"; |
| 55 } | 53 } |
| 56 | 54 |
| 57 std::wstring ChromeFrameDistribution::GetPublisherName() { | 55 string16 ChromeFrameDistribution::GetPublisherName() { |
| 58 const std::wstring& publisher_name = | 56 const string16& publisher_name = |
| 59 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); | 57 installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); |
| 60 return publisher_name; | 58 return publisher_name; |
| 61 } | 59 } |
| 62 | 60 |
| 63 std::wstring ChromeFrameDistribution::GetAppDescription() { | 61 string16 ChromeFrameDistribution::GetAppDescription() { |
| 64 return L"Chrome in a Frame."; | 62 return L"Chrome in a Frame."; |
| 65 } | 63 } |
| 66 | 64 |
| 67 std::wstring ChromeFrameDistribution::GetLongAppDescription() { | 65 string16 ChromeFrameDistribution::GetLongAppDescription() { |
| 68 return L"Chrome in a Frame."; | 66 return L"Chrome in a Frame."; |
| 69 } | 67 } |
| 70 | 68 |
| 71 std::string ChromeFrameDistribution::GetSafeBrowsingName() { | 69 std::string ChromeFrameDistribution::GetSafeBrowsingName() { |
| 72 return "googlechromeframe"; | 70 return "googlechromeframe"; |
| 73 } | 71 } |
| 74 | 72 |
| 75 std::wstring ChromeFrameDistribution::GetStateKey() { | 73 string16 ChromeFrameDistribution::GetStateKey() { |
| 76 std::wstring key(google_update::kRegPathClientState); | 74 string16 key(google_update::kRegPathClientState); |
| 77 key.append(L"\\"); | 75 key.append(L"\\"); |
| 78 key.append(kChromeFrameGuid); | 76 key.append(kChromeFrameGuid); |
| 79 return key; | 77 return key; |
| 80 } | 78 } |
| 81 | 79 |
| 82 std::wstring ChromeFrameDistribution::GetStateMediumKey() { | 80 string16 ChromeFrameDistribution::GetStateMediumKey() { |
| 83 std::wstring key(google_update::kRegPathClientStateMedium); | 81 string16 key(google_update::kRegPathClientStateMedium); |
| 84 key.append(L"\\"); | 82 key.append(L"\\"); |
| 85 key.append(kChromeFrameGuid); | 83 key.append(kChromeFrameGuid); |
| 86 return key; | 84 return key; |
| 87 } | 85 } |
| 88 | 86 |
| 89 std::wstring ChromeFrameDistribution::GetStatsServerURL() { | 87 string16 ChromeFrameDistribution::GetStatsServerURL() { |
| 90 return L"https://clients4.google.com/firefox/metrics/collect"; | 88 return L"https://clients4.google.com/firefox/metrics/collect"; |
| 91 } | 89 } |
| 92 | 90 |
| 93 std::string ChromeFrameDistribution::GetNetworkStatsServer() const { | 91 std::string ChromeFrameDistribution::GetNetworkStatsServer() const { |
| 94 return chrome_common_net::kEchoTestServerLocation; | 92 return chrome_common_net::kEchoTestServerLocation; |
| 95 } | 93 } |
| 96 | 94 |
| 97 std::string ChromeFrameDistribution::GetHttpPipeliningTestServer() const { | 95 std::string ChromeFrameDistribution::GetHttpPipeliningTestServer() const { |
| 98 return chrome_common_net::kPipelineTestServerBaseUrl; | 96 return chrome_common_net::kPipelineTestServerBaseUrl; |
| 99 } | 97 } |
| 100 | 98 |
| 101 std::wstring ChromeFrameDistribution::GetUninstallLinkName() { | 99 string16 ChromeFrameDistribution::GetUninstallLinkName() { |
| 102 return L"Uninstall Chrome Frame"; | 100 return L"Uninstall Chrome Frame"; |
| 103 } | 101 } |
| 104 | 102 |
| 105 std::wstring ChromeFrameDistribution::GetUninstallRegPath() { | 103 string16 ChromeFrameDistribution::GetUninstallRegPath() { |
| 106 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" | 104 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" |
| 107 L"Google Chrome Frame"; | 105 L"Google Chrome Frame"; |
| 108 } | 106 } |
| 109 | 107 |
| 110 std::wstring ChromeFrameDistribution::GetVersionKey() { | 108 string16 ChromeFrameDistribution::GetVersionKey() { |
| 111 std::wstring key(google_update::kRegPathClients); | 109 string16 key(google_update::kRegPathClients); |
| 112 key.append(L"\\"); | 110 key.append(L"\\"); |
| 113 key.append(kChromeFrameGuid); | 111 key.append(kChromeFrameGuid); |
| 114 return key; | 112 return key; |
| 115 } | 113 } |
| 116 | 114 |
| 117 bool ChromeFrameDistribution::CanSetAsDefault() { | 115 bool ChromeFrameDistribution::CanSetAsDefault() { |
| 118 return false; | 116 return false; |
| 119 } | 117 } |
| 120 | 118 |
| 121 bool ChromeFrameDistribution::CanCreateDesktopShortcuts() { | 119 bool ChromeFrameDistribution::CanCreateDesktopShortcuts() { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 132 | 130 |
| 133 void ChromeFrameDistribution::UpdateInstallStatus(bool system_install, | 131 void ChromeFrameDistribution::UpdateInstallStatus(bool system_install, |
| 134 installer::ArchiveType archive_type, | 132 installer::ArchiveType archive_type, |
| 135 installer::InstallStatus install_status) { | 133 installer::InstallStatus install_status) { |
| 136 #if defined(GOOGLE_CHROME_BUILD) | 134 #if defined(GOOGLE_CHROME_BUILD) |
| 137 GoogleUpdateSettings::UpdateInstallStatus(system_install, | 135 GoogleUpdateSettings::UpdateInstallStatus(system_install, |
| 138 archive_type, InstallUtil::GetInstallReturnCode(install_status), | 136 archive_type, InstallUtil::GetInstallReturnCode(install_status), |
| 139 kChromeFrameGuid); | 137 kChromeFrameGuid); |
| 140 #endif | 138 #endif |
| 141 } | 139 } |
| OLD | NEW |