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 #include "chrome/installer/util/google_update_util.h" | 5 #include "chrome/installer/util/google_update_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 bool EnsureUserLevelGoogleUpdatePresent() { | 173 bool EnsureUserLevelGoogleUpdatePresent() { |
174 LOG(INFO) << "Ensuring Google Update is present at user-level."; | 174 LOG(INFO) << "Ensuring Google Update is present at user-level."; |
175 | 175 |
176 bool success = false; | 176 bool success = false; |
177 if (IsGoogleUpdatePresent(false)) { | 177 if (IsGoogleUpdatePresent(false)) { |
178 success = true; | 178 success = true; |
179 } else { | 179 } else { |
180 string16 cmd_string; | 180 string16 cmd_string; |
181 if (!GetUserLevelGoogleUpdateInstallCommandLine(&cmd_string)) { | 181 if (!GetUserLevelGoogleUpdateInstallCommandLine(&cmd_string)) { |
182 LOG(ERROR) << "Cannot find Google Update at system-level."; | 182 LOG(ERROR) << "Cannot find Google Update at system-level."; |
| 183 // Ideally we should return false. However, this case should not be |
| 184 // encountered by regular users, and developers (who often installs |
| 185 // Chrome without Google Update) may be unduly impeded by this case. |
| 186 // Therefore we return true. |
| 187 success = true; |
183 } else { | 188 } else { |
184 success = LaunchProcessAndWaitWithTimeout(cmd_string, | 189 success = LaunchProcessAndWaitWithTimeout(cmd_string, |
185 base::TimeDelta::FromMilliseconds(INFINITE)); | 190 base::TimeDelta::FromMilliseconds(INFINITE)); |
186 } | 191 } |
187 } | 192 } |
188 return success; | 193 return success; |
189 } | 194 } |
190 | 195 |
191 bool UninstallGoogleUpdate(bool system_install) { | 196 bool UninstallGoogleUpdate(bool system_install) { |
192 bool success = false; | 197 bool success = false; |
(...skipping 14 matching lines...) Expand all Loading... |
207 std::map<std::string, std::string>::const_iterator data_it( | 212 std::map<std::string, std::string>::const_iterator data_it( |
208 untrusted_data.find(key)); | 213 untrusted_data.find(key)); |
209 if (data_it != untrusted_data.end()) | 214 if (data_it != untrusted_data.end()) |
210 return data_it->second; | 215 return data_it->second; |
211 } | 216 } |
212 | 217 |
213 return std::string(); | 218 return std::string(); |
214 } | 219 } |
215 | 220 |
216 } // namespace google_update | 221 } // namespace google_update |
OLD | NEW |