| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> |
| 13 | 14 |
| 14 #include "chrome/installer/util/work_item.h" | 15 #include "chrome/installer/util/work_item.h" |
| 15 | 16 |
| 16 class FilePath; | 17 class FilePath; |
| 17 | 18 |
| 18 // A WorkItem subclass that recursively contains a list of WorkItems. Thus it | 19 // A WorkItem subclass that recursively contains a list of WorkItems. Thus it |
| 19 // provides functionalities to carry out or roll back the sequence of actions | 20 // provides functionalities to carry out or roll back the sequence of actions |
| 20 // defined by the list of WorkItems it contains. | 21 // defined by the list of WorkItems it contains. |
| 21 // The WorkItems are executed in the same order as they are added to the list. | 22 // The WorkItems are executed in the same order as they are added to the list. |
| 22 class WorkItemList : public WorkItem { | 23 class WorkItemList : public WorkItem { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 53 // Add a DeleteRegValueWorkItem that deletes registry value of type REG_SZ | 54 // Add a DeleteRegValueWorkItem that deletes registry value of type REG_SZ |
| 54 // or REG_DWORD. | 55 // or REG_DWORD. |
| 55 bool AddDeleteRegValueWorkItem(HKEY predefined_root, | 56 bool AddDeleteRegValueWorkItem(HKEY predefined_root, |
| 56 const std::wstring& key_path, | 57 const std::wstring& key_path, |
| 57 const std::wstring& value_name, | 58 const std::wstring& value_name, |
| 58 bool is_str_type); | 59 bool is_str_type); |
| 59 | 60 |
| 60 // Add a DeleteTreeWorkItem that recursively deletes a file system | 61 // Add a DeleteTreeWorkItem that recursively deletes a file system |
| 61 // hierarchy at the given root path. A key file can be optionally specified | 62 // hierarchy at the given root path. A key file can be optionally specified |
| 62 // by key_path. | 63 // by key_path. |
| 63 bool AddDeleteTreeWorkItem(const std::wstring& root_path, | 64 bool AddDeleteTreeWorkItem(const FilePath& root_path, |
| 64 const std::wstring& key_path); | 65 const std::vector<FilePath>& key_paths); |
| 65 | 66 |
| 66 // Add a MoveTreeWorkItem to the list of work items. | 67 // Add a MoveTreeWorkItem to the list of work items. |
| 67 bool AddMoveTreeWorkItem(const std::wstring& source_path, | 68 bool AddMoveTreeWorkItem(const std::wstring& source_path, |
| 68 const std::wstring& dest_path, | 69 const std::wstring& dest_path, |
| 69 const std::wstring& temp_dir); | 70 const std::wstring& temp_dir); |
| 70 | 71 |
| 71 // Add a SetRegValueWorkItem that sets a registry value with REG_SZ type | 72 // Add a SetRegValueWorkItem that sets a registry value with REG_SZ type |
| 72 // at the key with specified path. | 73 // at the key with specified path. |
| 73 bool AddSetRegValueWorkItem(HKEY predefined_root, | 74 bool AddSetRegValueWorkItem(HKEY predefined_root, |
| 74 const std::wstring& key_path, | 75 const std::wstring& key_path, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // Execute the WorkItems in the same order as they are added to the list. | 130 // Execute the WorkItems in the same order as they are added to the list. |
| 130 // If a WorkItem fails, the function will return failure but all other | 131 // If a WorkItem fails, the function will return failure but all other |
| 131 // WorkItems will still be executed. | 132 // WorkItems will still be executed. |
| 132 virtual bool Do(); | 133 virtual bool Do(); |
| 133 | 134 |
| 134 // Just does a NOTREACHED. | 135 // Just does a NOTREACHED. |
| 135 virtual void Rollback(); | 136 virtual void Rollback(); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ | 139 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ |
| OLD | NEW |