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