| 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_WORK_ITEM_LIST_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ |
| 6 #define CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ | 6 #define CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 virtual bool Do(); | 30 virtual bool Do(); |
| 31 | 31 |
| 32 // Rollback the WorkItems in the reverse order as they are executed. | 32 // Rollback the WorkItems in the reverse order as they are executed. |
| 33 virtual void Rollback(); | 33 virtual void Rollback(); |
| 34 | 34 |
| 35 // Add a WorkItem to the list. | 35 // Add a WorkItem to the list. |
| 36 // A WorkItem can only be added to the list before the list's DO() is called. | 36 // A WorkItem can only be added to the list before the list's DO() is called. |
| 37 // Once a WorkItem is added to the list. The list owns the WorkItem. | 37 // Once a WorkItem is added to the list. The list owns the WorkItem. |
| 38 virtual void AddWorkItem(WorkItem* work_item); | 38 virtual void AddWorkItem(WorkItem* work_item); |
| 39 | 39 |
| 40 // Add a CopyRegKeyWorkItem that recursively copies a given registry key. |
| 41 virtual WorkItem* AddCopyRegKeyWorkItem(HKEY predefined_root, |
| 42 const std::wstring& source_key_path, |
| 43 const std::wstring& dest_key_path); |
| 44 |
| 40 // Add a CopyTreeWorkItem to the list of work items. | 45 // Add a CopyTreeWorkItem to the list of work items. |
| 41 // See the NOTE in the documentation for the CopyTreeWorkItem class for | 46 // See the NOTE in the documentation for the CopyTreeWorkItem class for |
| 42 // special considerations regarding |temp_dir|. | 47 // special considerations regarding |temp_dir|. |
| 43 virtual WorkItem* AddCopyTreeWorkItem( | 48 virtual WorkItem* AddCopyTreeWorkItem( |
| 44 const std::wstring& source_path, | 49 const std::wstring& source_path, |
| 45 const std::wstring& dest_path, | 50 const std::wstring& dest_path, |
| 46 const std::wstring& temp_dir, | 51 const std::wstring& temp_dir, |
| 47 CopyOverWriteOption overwrite_option, | 52 CopyOverWriteOption overwrite_option, |
| 48 const std::wstring& alternative_path = L""); | 53 const std::wstring& alternative_path = L""); |
| 49 | 54 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // Add a SetRegValueWorkItem that sets a registry value with REG_DWORD type | 100 // Add a SetRegValueWorkItem that sets a registry value with REG_DWORD type |
| 96 // at the key with specified path. | 101 // at the key with specified path. |
| 97 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, | 102 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, |
| 98 const std::wstring& key_path, | 103 const std::wstring& key_path, |
| 99 const std::wstring& value_name, | 104 const std::wstring& value_name, |
| 100 DWORD value_data, | 105 DWORD value_data, |
| 101 bool overwrite); | 106 bool overwrite); |
| 102 | 107 |
| 103 // Add a SetRegValueWorkItem that sets a registry value with REG_QWORD type | 108 // Add a SetRegValueWorkItem that sets a registry value with REG_QWORD type |
| 104 // at the key with specified path. | 109 // at the key with specified path. |
| 105 WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, | 110 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, |
| 106 const std::wstring& key_path, | 111 const std::wstring& key_path, |
| 107 const std::wstring& value_name, | 112 const std::wstring& value_name, |
| 108 int64 value_data, | 113 int64 value_data, |
| 109 bool overwrite); | 114 bool overwrite); |
| 110 | 115 |
| 111 // Add a SelfRegWorkItem that registers or unregisters a DLL at the | 116 // Add a SelfRegWorkItem that registers or unregisters a DLL at the |
| 112 // specified path. If user_level_registration is true, then alternate | 117 // specified path. If user_level_registration is true, then alternate |
| 113 // registration and unregistration entry point names will be used. | 118 // registration and unregistration entry point names will be used. |
| 114 virtual WorkItem* AddSelfRegWorkItem(const std::wstring& dll_path, | 119 virtual WorkItem* AddSelfRegWorkItem(const std::wstring& dll_path, |
| 115 bool do_register, | 120 bool do_register, |
| 116 bool user_level_registration); | 121 bool user_level_registration); |
| 117 | 122 |
| 118 protected: | 123 protected: |
| 119 friend class WorkItem; | 124 friend class WorkItem; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Execute the WorkItems in the same order as they are added to the list. | 158 // Execute the WorkItems in the same order as they are added to the list. |
| 154 // If a WorkItem fails, the function will return failure but all other | 159 // If a WorkItem fails, the function will return failure but all other |
| 155 // WorkItems will still be executed. | 160 // WorkItems will still be executed. |
| 156 virtual bool Do(); | 161 virtual bool Do(); |
| 157 | 162 |
| 158 // Just does a NOTREACHED. | 163 // Just does a NOTREACHED. |
| 159 virtual void Rollback(); | 164 virtual void Rollback(); |
| 160 }; | 165 }; |
| 161 | 166 |
| 162 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ | 167 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ |
| OLD | NEW |