| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 RegKey update_key; | 578 RegKey update_key; |
| 579 | 579 |
| 580 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, | 580 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, |
| 581 KEY_QUERY_VALUE) == ERROR_SUCCESS) { | 581 KEY_QUERY_VALUE) == ERROR_SUCCESS) { |
| 582 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line); | 582 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line); |
| 583 } | 583 } |
| 584 | 584 |
| 585 return cmd_line; | 585 return cmd_line; |
| 586 } | 586 } |
| 587 | 587 |
| 588 base::Version GoogleUpdateSettings::GetGoogleUpdateVersion( | 588 Version GoogleUpdateSettings::GetGoogleUpdateVersion(bool system_install) { |
| 589 bool system_install) { | |
| 590 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 589 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 591 base::string16 version; | 590 base::string16 version; |
| 592 RegKey key; | 591 RegKey key; |
| 593 | 592 |
| 594 if (key.Open(root_key, | 593 if (key.Open(root_key, |
| 595 google_update::kRegPathGoogleUpdate, | 594 google_update::kRegPathGoogleUpdate, |
| 596 KEY_QUERY_VALUE) == ERROR_SUCCESS && | 595 KEY_QUERY_VALUE) == ERROR_SUCCESS && |
| 597 key.ReadValue(google_update::kRegGoogleUpdateVersion, | 596 key.ReadValue(google_update::kRegGoogleUpdateVersion, |
| 598 &version) == ERROR_SUCCESS) { | 597 &version) == ERROR_SUCCESS) { |
| 599 return base::Version(base::UTF16ToUTF8(version)); | 598 return Version(base::UTF16ToUTF8(version)); |
| 600 } | 599 } |
| 601 | 600 |
| 602 return base::Version(); | 601 return Version(); |
| 603 } | 602 } |
| 604 | 603 |
| 605 base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU( | 604 base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU( |
| 606 bool system_install) { | 605 bool system_install) { |
| 607 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 606 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 608 RegKey update_key; | 607 RegKey update_key; |
| 609 | 608 |
| 610 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, | 609 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, |
| 611 KEY_QUERY_VALUE) == ERROR_SUCCESS) { | 610 KEY_QUERY_VALUE) == ERROR_SUCCESS) { |
| 612 DWORD last_start; | 611 DWORD last_start; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 } | 749 } |
| 751 | 750 |
| 752 // If the key or value was not present, return the empty string. | 751 // If the key or value was not present, return the empty string. |
| 753 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { | 752 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { |
| 754 experiment_labels->clear(); | 753 experiment_labels->clear(); |
| 755 return true; | 754 return true; |
| 756 } | 755 } |
| 757 | 756 |
| 758 return result == ERROR_SUCCESS; | 757 return result == ERROR_SUCCESS; |
| 759 } | 758 } |
| OLD | NEW |