| 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_settings.h" | 5 #include "chrome/installer/util/google_update_settings.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 RegKey update_key; | 791 RegKey update_key; |
| 792 | 792 |
| 793 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, | 793 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, |
| 794 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { | 794 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { |
| 795 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line); | 795 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line); |
| 796 } | 796 } |
| 797 | 797 |
| 798 return cmd_line; | 798 return cmd_line; |
| 799 } | 799 } |
| 800 | 800 |
| 801 base::Version GoogleUpdateSettings::GetGoogleUpdateVersion( | 801 Version GoogleUpdateSettings::GetGoogleUpdateVersion(bool system_install) { |
| 802 bool system_install) { | |
| 803 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 802 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 804 base::string16 version; | 803 base::string16 version; |
| 805 RegKey key; | 804 RegKey key; |
| 806 | 805 |
| 807 if (key.Open(root_key, | 806 if (key.Open(root_key, |
| 808 google_update::kRegPathGoogleUpdate, | 807 google_update::kRegPathGoogleUpdate, |
| 809 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS && | 808 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS && |
| 810 key.ReadValue(google_update::kRegGoogleUpdateVersion, &version) == | 809 key.ReadValue(google_update::kRegGoogleUpdateVersion, &version) == |
| 811 ERROR_SUCCESS) { | 810 ERROR_SUCCESS) { |
| 812 return base::Version(base::UTF16ToUTF8(version)); | 811 return Version(base::UTF16ToUTF8(version)); |
| 813 } | 812 } |
| 814 | 813 |
| 815 return base::Version(); | 814 return Version(); |
| 816 } | 815 } |
| 817 | 816 |
| 818 base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU( | 817 base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU( |
| 819 bool system_install) { | 818 bool system_install) { |
| 820 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 819 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 821 RegKey update_key; | 820 RegKey update_key; |
| 822 | 821 |
| 823 if (update_key.Open(root_key, | 822 if (update_key.Open(root_key, |
| 824 google_update::kRegPathGoogleUpdate, | 823 google_update::kRegPathGoogleUpdate, |
| 825 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { | 824 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 } | 969 } |
| 971 | 970 |
| 972 // If the key or value was not present, return the empty string. | 971 // If the key or value was not present, return the empty string. |
| 973 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { | 972 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { |
| 974 experiment_labels->clear(); | 973 experiment_labels->clear(); |
| 975 return true; | 974 return true; |
| 976 } | 975 } |
| 977 | 976 |
| 978 return result == ERROR_SUCCESS; | 977 return result == ERROR_SUCCESS; |
| 979 } | 978 } |
| OLD | NEW |