Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / installer / util / delete_reg_key_work_item.h
blob4b92b9485acff7aef0f07ac37bcf23a2bcc0e59d
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_KEY_WORK_ITEM_H_
6 #define CHROME_INSTALLER_UTIL_DELETE_REG_KEY_WORK_ITEM_H_
8 #include <windows.h>
10 #include <string>
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "chrome/installer/util/registry_key_backup.h"
15 #include "chrome/installer/util/work_item.h"
17 class RegistryKeyBackup;
19 // A WorkItem subclass that deletes a registry key at the given path. Be aware
20 // that in the event of rollback the key's values and subkeys are restored but
21 // the key and its subkeys take on their default security descriptors.
22 class DeleteRegKeyWorkItem : public WorkItem {
23 public:
24 virtual ~DeleteRegKeyWorkItem();
26 virtual bool Do() OVERRIDE;
28 virtual void Rollback() OVERRIDE;
30 private:
31 friend class WorkItem;
33 DeleteRegKeyWorkItem(HKEY predefined_root, const std::wstring& path);
35 // Root key from which we delete the key. The root key can only be
36 // one of the predefined keys on Windows.
37 HKEY predefined_root_;
39 // Path of the key to be deleted.
40 std::wstring path_;
42 // Backup of the deleted key.
43 RegistryKeyBackup backup_;
45 DISALLOW_COPY_AND_ASSIGN(DeleteRegKeyWorkItem);
48 #endif // CHROME_INSTALLER_UTIL_DELETE_REG_KEY_WORK_ITEM_H_