diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 06:36:27 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 06:36:27 +0000 |
commit | b0eebb403ad069142ec43e566134f4000f0f0f19 (patch) | |
tree | cc2f2a64fcf34264449031758c589055fd2072cf /chrome/installer/gcapi/gcapi_reactivation.cc | |
parent | a20548491e2b97baf01fa8d103eca5c1dd8d80db (diff) | |
download | chromium_src-b0eebb403ad069142ec43e566134f4000f0f0f19.zip chromium_src-b0eebb403ad069142ec43e566134f4000f0f0f19.tar.gz chromium_src-b0eebb403ad069142ec43e566134f4000f0f0f19.tar.bz2 |
Revert 119841 - Implementation of GCAPI reactivation.
Also, some cleanup in gcapi_tests such that it now only runs gtest tests by default.
BUG=111453
TEST=gcapi_tests.exe
Review URL: https://chromiumcodereview.appspot.com/9288056
TBR=robertshield@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9302029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119865 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/gcapi/gcapi_reactivation.cc')
-rw-r--r-- | chrome/installer/gcapi/gcapi_reactivation.cc | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/chrome/installer/gcapi/gcapi_reactivation.cc b/chrome/installer/gcapi/gcapi_reactivation.cc deleted file mode 100644 index 6755e2f..0000000 --- a/chrome/installer/gcapi/gcapi_reactivation.cc +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/installer/gcapi/gcapi_reactivation.h" - -#include "base/time.h" -#include "base/win/registry.h" -#include "chrome/installer/util/google_update_constants.h" - -using base::Time; -using base::win::RegKey; - -namespace { -const wchar_t kReactivationHistoryKey[] = L"reactivation"; - -std::wstring GetReactivationHistoryKeyPath() { - std::wstring reactivation_path(google_update::kRegPathClientState); - reactivation_path += L"\\"; - reactivation_path += google_update::kChromeUpgradeCode; - reactivation_path += L"\\"; - reactivation_path += kReactivationHistoryKey; - return reactivation_path; -} -} // namespace - -bool HasBeenReactivatedByBrandCodes( - const std::vector<std::wstring>& brand_codes) { - bool success = false; - - RegKey reactivation_key(HKEY_CURRENT_USER, - GetReactivationHistoryKeyPath().c_str(), - KEY_QUERY_VALUE); - if (reactivation_key.Valid()) { - std::vector<std::wstring>::const_iterator brand_iter(brand_codes.begin()); - for (; brand_iter != brand_codes.end(); ++brand_iter) { - if (reactivation_key.HasValue(brand_iter->c_str())) { - success = true; - break; - } - } - } - - return success; -} - -bool SetReactivationBrandCode(const std::wstring& brand_code) { - bool success = false; - - std::wstring path(google_update::kRegPathClientState); - path += L"\\"; - path += google_update::kChromeUpgradeCode; - - RegKey client_state_key(HKEY_CURRENT_USER, path.c_str(), KEY_SET_VALUE); - if (client_state_key.Valid()) { - success = client_state_key.WriteValue( - google_update::kRegRLZReactivationBrandField, - brand_code.c_str()) == ERROR_SUCCESS; - } - - if (success) { - // Store this brand code in the reactivation history. Store it with a - // a currently un-used timestamp for future proofing. - RegKey reactivation_key(HKEY_CURRENT_USER, - GetReactivationHistoryKeyPath().c_str(), - KEY_WRITE); - if (reactivation_key.Valid()) { - int64 timestamp = Time::Now().ToInternalValue(); - reactivation_key.WriteValue(brand_code.c_str(), - ×tamp, - sizeof(timestamp), - REG_QWORD); - } - } - - return success; -}
\ No newline at end of file |