OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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> | 12 #include <string> |
13 #include <windows.h> | 13 #include <windows.h> |
14 | 14 |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/registry.h" | 16 #include "base/registry.h" |
17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
18 #include "chrome/installer/util/l10n_string_util.h" | 18 #include "chrome/installer/util/l10n_string_util.h" |
19 #include "chrome/installer/util/google_update_constants.h" | 19 #include "chrome/installer/util/google_update_constants.h" |
| 20 #include "chrome/installer/util/google_update_settings.h" |
20 | 21 |
21 #include "installer_util_strings.h" | 22 #include "installer_util_strings.h" |
22 | 23 |
23 namespace { | 24 namespace { |
24 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; | 25 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; |
25 } | 26 } |
26 | 27 |
27 std::wstring ChromeFrameDistribution::GetAppGuid() { | 28 std::wstring ChromeFrameDistribution::GetAppGuid() { |
28 return kChromeFrameGuid; | 29 return kChromeFrameGuid; |
29 } | 30 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 std::wstring ChromeFrameDistribution::GetEnvVersionKey() { | 101 std::wstring ChromeFrameDistribution::GetEnvVersionKey() { |
101 return L"CHROME_FRAME_VERSION"; | 102 return L"CHROME_FRAME_VERSION"; |
102 } | 103 } |
103 | 104 |
104 bool ChromeFrameDistribution::CanSetAsDefault() { | 105 bool ChromeFrameDistribution::CanSetAsDefault() { |
105 return false; | 106 return false; |
106 } | 107 } |
107 | 108 |
108 void ChromeFrameDistribution::UpdateDiffInstallStatus(bool system_install, | 109 void ChromeFrameDistribution::UpdateDiffInstallStatus(bool system_install, |
109 bool incremental_install, installer_util::InstallStatus install_status) { | 110 bool incremental_install, installer_util::InstallStatus install_status) { |
110 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 111 GoogleUpdateSettings::UpdateDiffInstallStatus(system_install, |
111 RegKey key; | 112 incremental_install, GetInstallReturnCode(install_status), |
112 std::wstring ap_key_value; | 113 kChromeFrameGuid); |
113 std::wstring reg_key(google_update::kRegPathClientState); | |
114 reg_key.append(L"\\"); | |
115 reg_key.append(kChromeFrameGuid); | |
116 if (!key.Open(reg_root, reg_key.c_str(), KEY_ALL_ACCESS) || | |
117 !key.ReadValue(google_update::kRegApField, &ap_key_value)) { | |
118 LOG(INFO) << "Application key not found."; | |
119 } else { | |
120 const char kMagicSuffix[] = "-full"; | |
121 if (LowerCaseEqualsASCII(ap_key_value, kMagicSuffix)) { | |
122 key.DeleteValue(google_update::kRegApField); | |
123 } else { | |
124 size_t pos = ap_key_value.find(ASCIIToWide(kMagicSuffix)); | |
125 if (pos != std::wstring::npos) { | |
126 ap_key_value.erase(pos, strlen(kMagicSuffix)); | |
127 key.WriteValue(google_update::kRegApField, ap_key_value.c_str()); | |
128 } | |
129 } | |
130 } | |
131 } | 114 } |
OLD | NEW |