| 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 // Base class for managing an action of a sequence of actions to be carried | 5 // Base class for managing an action of a sequence of actions to be carried |
| 6 // out during install/update/uninstall. Supports rollback of actions if this | 6 // out during install/update/uninstall. Supports rollback of actions if this |
| 7 // process fails. | 7 // process fails. |
| 8 | 8 |
| 9 #ifndef CHROME_INSTALLER_UTIL_WORK_ITEM_H_ | 9 #ifndef CHROME_INSTALLER_UTIL_WORK_ITEM_H_ |
| 10 #define CHROME_INSTALLER_UTIL_WORK_ITEM_H_ | 10 #define CHROME_INSTALLER_UTIL_WORK_ITEM_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <windows.h> | 13 #include <windows.h> |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 | 19 |
| 20 class CopyRegKeyWorkItem; |
| 20 class CopyTreeWorkItem; | 21 class CopyTreeWorkItem; |
| 21 class CreateDirWorkItem; | 22 class CreateDirWorkItem; |
| 22 class CreateRegKeyWorkItem; | 23 class CreateRegKeyWorkItem; |
| 23 class DeleteTreeWorkItem; | 24 class DeleteTreeWorkItem; |
| 24 class DeleteRegKeyWorkItem; | 25 class DeleteRegKeyWorkItem; |
| 25 class DeleteRegValueWorkItem; | 26 class DeleteRegValueWorkItem; |
| 26 class FilePath; | 27 class FilePath; |
| 27 class MoveTreeWorkItem; | 28 class MoveTreeWorkItem; |
| 28 class SelfRegWorkItem; | 29 class SelfRegWorkItem; |
| 29 class SetRegValueWorkItem; | 30 class SetRegValueWorkItem; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 51 // Abstract base class for the conditions used by ConditionWorkItemList. | 52 // Abstract base class for the conditions used by ConditionWorkItemList. |
| 52 // TODO(robertshield): Move this out of WorkItem. | 53 // TODO(robertshield): Move this out of WorkItem. |
| 53 class Condition { | 54 class Condition { |
| 54 public: | 55 public: |
| 55 virtual ~Condition() {} | 56 virtual ~Condition() {} |
| 56 virtual bool ShouldRun() const = 0; | 57 virtual bool ShouldRun() const = 0; |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 virtual ~WorkItem(); | 60 virtual ~WorkItem(); |
| 60 | 61 |
| 62 // Create a CopyRegKeyWorkItem that recursively copies a given registry key. |
| 63 static CopyRegKeyWorkItem* CreateCopyRegKeyWorkItem( |
| 64 HKEY predefined_root, |
| 65 const std::wstring& source_key_path, |
| 66 const std::wstring& dest_key_path); |
| 67 |
| 61 // Create a CopyTreeWorkItem that recursively copies a file system hierarchy | 68 // Create a CopyTreeWorkItem that recursively copies a file system hierarchy |
| 62 // from source path to destination path. | 69 // from source path to destination path. |
| 63 // * If overwrite_option is ALWAYS, the created CopyTreeWorkItem always | 70 // * If overwrite_option is ALWAYS, the created CopyTreeWorkItem always |
| 64 // overwrites files. | 71 // overwrites files. |
| 65 // * If overwrite_option is NEW_NAME_IF_IN_USE, file is copied with an | 72 // * If overwrite_option is NEW_NAME_IF_IN_USE, file is copied with an |
| 66 // alternate name specified by alternative_path. | 73 // alternate name specified by alternative_path. |
| 67 static CopyTreeWorkItem* CreateCopyTreeWorkItem( | 74 static CopyTreeWorkItem* CreateCopyTreeWorkItem( |
| 68 const FilePath& source_path, | 75 const FilePath& source_path, |
| 69 const FilePath& dest_path, | 76 const FilePath& dest_path, |
| 70 const FilePath& temp_dir, | 77 const FilePath& temp_dir, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 WorkItem(); | 189 WorkItem(); |
| 183 | 190 |
| 184 // Specifies whether this work item my fail to complete and yet still | 191 // Specifies whether this work item my fail to complete and yet still |
| 185 // return true from Do(). | 192 // return true from Do(). |
| 186 bool ignore_failure_; | 193 bool ignore_failure_; |
| 187 | 194 |
| 188 std::string log_message_; | 195 std::string log_message_; |
| 189 }; | 196 }; |
| 190 | 197 |
| 191 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_H_ | 198 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_H_ |
| OLD | NEW |