| 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_MOVE_TREE_WORK_ITEM_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_MOVE_TREE_WORK_ITEM_H_ |
| 6 #define CHROME_INSTALLER_UTIL_MOVE_TREE_WORK_ITEM_H_ | 6 #define CHROME_INSTALLER_UTIL_MOVE_TREE_WORK_ITEM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | |
| 10 | |
| 11 #include <string> | |
| 12 | |
| 13 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/scoped_temp_dir.h" |
| 14 #include "chrome/installer/util/work_item.h" | 11 #include "chrome/installer/util/work_item.h" |
| 15 | 12 |
| 16 // A WorkItem subclass that recursively move a file system hierarchy from | 13 // A WorkItem subclass that recursively move a file system hierarchy from |
| 17 // source path to destination path. The file system hierarchy could be a | 14 // source path to destination path. The file system hierarchy could be a |
| 18 // single file, or a directory. | 15 // single file, or a directory. |
| 19 // | 16 // |
| 20 // Under the cover MoveTreeWorkItem moves the destination path, if existing, | 17 // Under the cover MoveTreeWorkItem moves the destination path, if existing, |
| 21 // to the temporary directory passed in, and then moves the source hierarchy | 18 // to the temporary directory passed in, and then moves the source hierarchy |
| 22 // to the destination location. During rollback the original destination | 19 // to the destination location. During rollback the original destination |
| 23 // hierarchy is moved back. | 20 // hierarchy is moved back. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 42 | 39 |
| 43 // Source path to move files from. | 40 // Source path to move files from. |
| 44 FilePath source_path_; | 41 FilePath source_path_; |
| 45 | 42 |
| 46 // Destination path to move files to. | 43 // Destination path to move files to. |
| 47 FilePath dest_path_; | 44 FilePath dest_path_; |
| 48 | 45 |
| 49 // Temporary directory to backup dest_path_ (if it already exists). | 46 // Temporary directory to backup dest_path_ (if it already exists). |
| 50 FilePath temp_dir_; | 47 FilePath temp_dir_; |
| 51 | 48 |
| 52 // The full path in temp_dir_ where the original dest_path_ has | 49 // The temporary directory into which the original dest_path_ has been moved. |
| 53 // been moved to. | 50 ScopedTempDir backup_path_; |
| 54 FilePath backup_path_; | |
| 55 | 51 |
| 56 // Whether the source was moved to dest_path_ | 52 // Whether the source was moved to dest_path_ |
| 57 bool moved_to_dest_path_; | 53 bool moved_to_dest_path_; |
| 58 | 54 |
| 59 // Whether the original files have been moved to backup path under | 55 // Whether the original files have been moved to backup path under |
| 60 // temporary directory. If true, moving back is needed during rollback. | 56 // temporary directory. If true, moving back is needed during rollback. |
| 61 bool moved_to_backup_; | 57 bool moved_to_backup_; |
| 62 }; | 58 }; |
| 63 | 59 |
| 64 #endif // CHROME_INSTALLER_UTIL_MOVE_TREE_WORK_ITEM_H_ | 60 #endif // CHROME_INSTALLER_UTIL_MOVE_TREE_WORK_ITEM_H_ |
| OLD | NEW |