| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ |
| 6 #define CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | 6 #define CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class CopyRegKeyWorkItem : public WorkItem { | 21 class CopyRegKeyWorkItem : public WorkItem { |
| 22 public: | 22 public: |
| 23 virtual ~CopyRegKeyWorkItem(); | 23 virtual ~CopyRegKeyWorkItem(); |
| 24 virtual bool Do() OVERRIDE; | 24 virtual bool Do() OVERRIDE; |
| 25 virtual void Rollback() OVERRIDE; | 25 virtual void Rollback() OVERRIDE; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 friend class WorkItem; | 28 friend class WorkItem; |
| 29 | 29 |
| 30 // Neither |source_key_path| nor |dest_key_path| may be empty. | 30 // Neither |source_key_path| nor |dest_key_path| may be empty. |
| 31 // Only ALWAYS and IF_NOT_PRESENT are supported for |overwrite_option|. |
| 31 CopyRegKeyWorkItem(HKEY predefined_key, | 32 CopyRegKeyWorkItem(HKEY predefined_key, |
| 32 const std::wstring& source_key_path, | 33 const std::wstring& source_key_path, |
| 33 const std::wstring& dest_key_path); | 34 const std::wstring& dest_key_path, |
| 35 CopyOverWriteOption overwrite_option); |
| 34 | 36 |
| 35 // Root key in which we operate. The root key must be one of the predefined | 37 // Root key in which we operate. The root key must be one of the predefined |
| 36 // keys on Windows. | 38 // keys on Windows. |
| 37 HKEY predefined_root_; | 39 HKEY predefined_root_; |
| 38 | 40 |
| 39 // Path of the key to be copied. | 41 // Path of the key to be copied. |
| 40 std::wstring source_key_path_; | 42 std::wstring source_key_path_; |
| 41 | 43 |
| 42 // Path of the destination key. | 44 // Path of the destination key. |
| 43 std::wstring dest_key_path_; | 45 std::wstring dest_key_path_; |
| 44 | 46 |
| 47 CopyOverWriteOption overwrite_option_; |
| 48 |
| 45 // Backup of the destination key. | 49 // Backup of the destination key. |
| 46 RegistryKeyBackup backup_; | 50 RegistryKeyBackup backup_; |
| 47 | 51 |
| 52 // Set to true after the destination is cleared for the copy. |
| 53 bool cleared_destination_; |
| 54 |
| 48 DISALLOW_COPY_AND_ASSIGN(CopyRegKeyWorkItem); | 55 DISALLOW_COPY_AND_ASSIGN(CopyRegKeyWorkItem); |
| 49 }; | 56 }; |
| 50 | 57 |
| 51 #endif // CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | 58 #endif // CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ |
| OLD | NEW |