1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_
6 #define CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_
12 #include "chrome/installer/util/work_item.h"
14 // A WorkItem subclass that deletes a registry value with REG_SZ, REG_DWORD, or
15 // REG_QWORD type at the specified path. The value is only deleted if the target
17 class DeleteRegValueWorkItem
: public WorkItem
{
19 ~DeleteRegValueWorkItem() override
;
23 void Rollback() override
;
26 friend class WorkItem
;
29 // The status before Do is called.
31 // One possible outcome after Do(). Value is deleted.
33 // One possible outcome after Do(). Value is not found.
35 // The status after Do() and Rollback() is called.
37 // Another possible outcome after Do() (when there is an error).
41 DeleteRegValueWorkItem(HKEY predefined_root
,
42 const std::wstring
& key_path
,
44 const std::wstring
& value_name
);
46 // Root key of the target key under which the value is set. The root key can
47 // only be one of the predefined keys on Windows.
48 HKEY predefined_root_
;
50 // Path of the target key under which the value is set.
51 std::wstring key_path_
;
53 // Name of the value to be set.
54 std::wstring value_name_
;
56 // Whether to force 32-bit or 64-bit view of the target key.
59 DeletionStatus status_
;
63 std::string previous_value_
;
66 #endif // CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_