Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: chrome/installer/util/google_update_settings.cc

Issue 2258243002: Consistently use namespaced base::Version in chrome/installer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 RegKey update_key; 862 RegKey update_key;
863 863
864 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, 864 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate,
865 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { 865 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) {
866 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line); 866 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line);
867 } 867 }
868 868
869 return cmd_line; 869 return cmd_line;
870 } 870 }
871 871
872 Version GoogleUpdateSettings::GetGoogleUpdateVersion(bool system_install) { 872 base::Version GoogleUpdateSettings::GetGoogleUpdateVersion(
873 bool system_install) {
873 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 874 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
874 base::string16 version; 875 base::string16 version;
875 RegKey key; 876 RegKey key;
876 877
877 if (key.Open(root_key, 878 if (key.Open(root_key,
878 google_update::kRegPathGoogleUpdate, 879 google_update::kRegPathGoogleUpdate,
879 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS && 880 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS &&
880 key.ReadValue(google_update::kRegGoogleUpdateVersion, &version) == 881 key.ReadValue(google_update::kRegGoogleUpdateVersion, &version) ==
881 ERROR_SUCCESS) { 882 ERROR_SUCCESS) {
882 return Version(base::UTF16ToUTF8(version)); 883 return base::Version(base::UTF16ToUTF8(version));
883 } 884 }
884 885
885 return Version(); 886 return base::Version();
886 } 887 }
887 888
888 base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU( 889 base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU(
889 bool system_install) { 890 bool system_install) {
890 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 891 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
891 RegKey update_key; 892 RegKey update_key;
892 893
893 if (update_key.Open(root_key, 894 if (update_key.Open(root_key,
894 google_update::kRegPathGoogleUpdate, 895 google_update::kRegPathGoogleUpdate,
895 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { 896 KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 } 1041 }
1041 1042
1042 // If the key or value was not present, return the empty string. 1043 // If the key or value was not present, return the empty string.
1043 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { 1044 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) {
1044 experiment_labels->clear(); 1045 experiment_labels->clear();
1045 return true; 1046 return true;
1046 } 1047 }
1047 1048
1048 return result == ERROR_SUCCESS; 1049 return result == ERROR_SUCCESS;
1049 } 1050 }
OLDNEW
« no previous file with comments | « chrome/installer/util/google_update_settings.h ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698