| 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 25 matching lines...) Expand all Loading... |
| 36 const int kEnvVariableUntrustedDataMaxLength = 4096; | 36 const int kEnvVariableUntrustedDataMaxLength = 4096; |
| 37 | 37 |
| 38 // Returns true if Google Update is present at the given level. | 38 // Returns true if Google Update is present at the given level. |
| 39 bool IsGoogleUpdatePresent(bool system_install) { | 39 bool IsGoogleUpdatePresent(bool system_install) { |
| 40 // Using the existence of version key in the registry to decide. | 40 // Using the existence of version key in the registry to decide. |
| 41 return GoogleUpdateSettings::GetGoogleUpdateVersion(system_install).IsValid(); | 41 return GoogleUpdateSettings::GetGoogleUpdateVersion(system_install).IsValid(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // Returns GoogleUpdateSetup.exe's executable path at specified level. | 44 // Returns GoogleUpdateSetup.exe's executable path at specified level. |
| 45 // or an empty path if none is found. | 45 // or an empty path if none is found. |
| 46 FilePath GetGoogleUpdateSetupExe(bool system_install) { | 46 base::FilePath GetGoogleUpdateSetupExe(bool system_install) { |
| 47 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 47 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 48 RegKey update_key; | 48 RegKey update_key; |
| 49 | 49 |
| 50 if (update_key.Open(root_key, kRegPathGoogleUpdate, KEY_QUERY_VALUE) == | 50 if (update_key.Open(root_key, kRegPathGoogleUpdate, KEY_QUERY_VALUE) == |
| 51 ERROR_SUCCESS) { | 51 ERROR_SUCCESS) { |
| 52 string16 path_str; | 52 string16 path_str; |
| 53 string16 version_str; | 53 string16 version_str; |
| 54 if ((update_key.ReadValue(kRegPathField, &path_str) == ERROR_SUCCESS) && | 54 if ((update_key.ReadValue(kRegPathField, &path_str) == ERROR_SUCCESS) && |
| 55 (update_key.ReadValue(kRegGoogleUpdateVersion, &version_str) == | 55 (update_key.ReadValue(kRegGoogleUpdateVersion, &version_str) == |
| 56 ERROR_SUCCESS)) { | 56 ERROR_SUCCESS)) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 std::map<std::string, std::string>::const_iterator data_it( | 214 std::map<std::string, std::string>::const_iterator data_it( |
| 215 untrusted_data.find(key)); | 215 untrusted_data.find(key)); |
| 216 if (data_it != untrusted_data.end()) | 216 if (data_it != untrusted_data.end()) |
| 217 return data_it->second; | 217 return data_it->second; |
| 218 } | 218 } |
| 219 | 219 |
| 220 return std::string(); | 220 return std::string(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace google_update | 223 } // namespace google_update |
| OLD | NEW |