| 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/gcapi/gcapi_reactivation.h" | 5 #include "chrome/installer/gcapi/gcapi_reactivation.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 8 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
| 9 #include "chrome/installer/gcapi/gcapi.h" | 11 #include "chrome/installer/gcapi/gcapi.h" |
| 10 #include "chrome/installer/util/google_update_constants.h" | 12 #include "chrome/installer/util/google_update_constants.h" |
| 11 | 13 |
| 12 using base::Time; | 14 using base::Time; |
| 13 using base::win::RegKey; | 15 using base::win::RegKey; |
| 14 | 16 |
| 15 namespace { | 17 namespace { |
| 16 const wchar_t kReactivationHistoryKey[] = L"reactivation"; | 18 const wchar_t kReactivationHistoryKey[] = L"reactivation"; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 brand_code.c_str()) == ERROR_SUCCESS; | 55 brand_code.c_str()) == ERROR_SUCCESS; |
| 54 } | 56 } |
| 55 | 57 |
| 56 if (success) { | 58 if (success) { |
| 57 // Store this brand code in the reactivation history. Store it with a | 59 // Store this brand code in the reactivation history. Store it with a |
| 58 // a currently un-used timestamp for future proofing. | 60 // a currently un-used timestamp for future proofing. |
| 59 RegKey reactivation_key(HKEY_CURRENT_USER, | 61 RegKey reactivation_key(HKEY_CURRENT_USER, |
| 60 GetReactivationHistoryKeyPath().c_str(), | 62 GetReactivationHistoryKeyPath().c_str(), |
| 61 KEY_WRITE | KEY_WOW64_32KEY); | 63 KEY_WRITE | KEY_WOW64_32KEY); |
| 62 if (reactivation_key.Valid()) { | 64 if (reactivation_key.Valid()) { |
| 63 int64 timestamp = Time::Now().ToInternalValue(); | 65 int64_t timestamp = Time::Now().ToInternalValue(); |
| 64 reactivation_key.WriteValue(brand_code.c_str(), | 66 reactivation_key.WriteValue(brand_code.c_str(), |
| 65 ×tamp, | 67 ×tamp, |
| 66 sizeof(timestamp), | 68 sizeof(timestamp), |
| 67 REG_QWORD); | 69 REG_QWORD); |
| 68 } | 70 } |
| 69 } | 71 } |
| 70 | 72 |
| 71 return success; | 73 return success; |
| 72 } | 74 } |
| 73 | 75 |
| OLD | NEW |