Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: chrome/installer/util/chrome_frame_distribution.cc

Issue 2725007: Reverting this as it caused installer_unit_tests to fail. Please fix and rela... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
21 20
22 #include "installer_util_strings.h" 21 #include "installer_util_strings.h"
23 22
24 namespace { 23 namespace {
25 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; 24 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}";
26 } 25 }
27 26
28 std::wstring ChromeFrameDistribution::GetAppGuid() { 27 std::wstring ChromeFrameDistribution::GetAppGuid() {
29 return kChromeFrameGuid; 28 return kChromeFrameGuid;
30 } 29 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 std::wstring ChromeFrameDistribution::GetEnvVersionKey() { 100 std::wstring ChromeFrameDistribution::GetEnvVersionKey() {
102 return L"CHROME_FRAME_VERSION"; 101 return L"CHROME_FRAME_VERSION";
103 } 102 }
104 103
105 bool ChromeFrameDistribution::CanSetAsDefault() { 104 bool ChromeFrameDistribution::CanSetAsDefault() {
106 return false; 105 return false;
107 } 106 }
108 107
109 void ChromeFrameDistribution::UpdateDiffInstallStatus(bool system_install, 108 void ChromeFrameDistribution::UpdateDiffInstallStatus(bool system_install,
110 bool incremental_install, installer_util::InstallStatus install_status) { 109 bool incremental_install, installer_util::InstallStatus install_status) {
111 GoogleUpdateSettings::UpdateDiffInstallStatus(system_install, 110 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
112 incremental_install, GetInstallReturnCode(install_status), 111 RegKey key;
113 kChromeFrameGuid); 112 std::wstring ap_key_value;
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 }
114 } 131 }
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/util/google_chrome_distribution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698